diff --git a/Library/ConfigParser.cpp b/Library/ConfigParser.cpp index 4121c395..2c619a7e 100644 --- a/Library/ConfigParser.cpp +++ b/Library/ConfigParser.cpp @@ -744,9 +744,9 @@ double CConfigParser::ReadFormula(LPCTSTR section, LPCTSTR key, double defValue) error += ConvertToWide(errMsg); error += L" in key \""; error += key ? key : L""; - error += L"\" in section ["; + error += L"\" in ["; error += section ? section : L""; - error += L"]."; + error += L"]"; Log(LOG_ERROR, error.c_str()); } diff --git a/Library/Error.h b/Library/Error.h index 2fcb28c4..7ca59fed 100644 --- a/Library/Error.h +++ b/Library/Error.h @@ -25,17 +25,13 @@ class CError { public: - CError(const std::wstring& String) : m_String(String), m_File(NULL) {} - CError(const WCHAR* String ) : m_String(String), m_File(NULL) {} - CError(const std::wstring& String, int Line, const char* File) : m_String(String), m_Line(Line), m_File(File) {} - CError(const WCHAR* String, int Line, const char* File) : m_String(String), m_Line(Line), m_File(File) {} + CError(const std::wstring& String) : m_String(String) {} + CError(const WCHAR* String ) : m_String(String) {} const std::wstring& GetString(); private: std::wstring m_String; - int m_Line; - const char* m_File; }; #endif diff --git a/Library/Measure.cpp b/Library/Measure.cpp index b062c211..aa1dbd1f 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -836,7 +836,7 @@ CMeasure* CMeasure::Create(const WCHAR* measure, CMeterWindow* meterWindow, cons error += L" is not valid in ["; error += name; error += L"]"; - throw CError(error, __LINE__, __FILE__); + throw CError(error); return NULL; } diff --git a/Library/MeasureCalc.cpp b/Library/MeasureCalc.cpp index 66b21e2f..5cb0907b 100644 --- a/Library/MeasureCalc.cpp +++ b/Library/MeasureCalc.cpp @@ -84,9 +84,9 @@ bool CMeasureCalc::Update() { std::wstring error = L"Calc: "; error += ConvertToWide(errMsg); - error += L" in measure ["; + error += L" in ["; error += m_Name; - error += L"]."; + error += L"]"; Log(LOG_ERROR, error.c_str()); } diff --git a/Library/MeasurePlugin.cpp b/Library/MeasurePlugin.cpp index 7f77b083..51a14de5 100644 --- a/Library/MeasurePlugin.cpp +++ b/Library/MeasurePlugin.cpp @@ -151,7 +151,7 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section) { std::wstring error = L"Plugin: \"" + m_PluginName; error += L"\" not found"; - throw CError(error, __LINE__, __FILE__); + throw CError(error); } } @@ -167,8 +167,8 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section) FreeLibrary(m_Plugin); std::wstring error = L"Plugin: \"" + m_PluginName; - error += L"\" doesn't export Update() or GetString()!"; - throw CError(error, __LINE__, __FILE__); + error += L"\" doesn't export Update() or GetString()"; + throw CError(error); } // Initialize the plugin diff --git a/Library/MeasureRegistry.cpp b/Library/MeasureRegistry.cpp index 52b3ead2..5dee4317 100644 --- a/Library/MeasureRegistry.cpp +++ b/Library/MeasureRegistry.cpp @@ -154,7 +154,7 @@ void CMeasureRegistry::ReadConfig(CConfigParser& parser, const WCHAR* section) error += L" is not valid in ["; error += m_Name; error += L"]"; - throw CError(error, __LINE__, __FILE__); + throw CError(error); } m_RegKeyName = parser.ReadString(section, L"RegKey", L""); diff --git a/Library/Meter.cpp b/Library/Meter.cpp index 1a2d94f4..141c6234 100644 --- a/Library/Meter.cpp +++ b/Library/Meter.cpp @@ -462,8 +462,8 @@ void CMeter::BindMeasure(const std::list& measures) if (m_MeasureName.empty()) { std::wstring error = L"The meter [" + m_Name; - error += L"] is unbound!"; - throw CError(error, __LINE__, __FILE__); + error += L"] is unbound"; + throw CError(error); } // Go through the list and check it there is a measure for us @@ -481,8 +481,8 @@ void CMeter::BindMeasure(const std::list& measures) std::wstring error = L"The meter [" + m_Name; error += L"] cannot be bound with ["; error += m_MeasureName; - error += L"]!"; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } /* @@ -534,10 +534,10 @@ CMeter* CMeter::Create(const WCHAR* meter, CMeterWindow* meterWindow, const WCHA // Error std::wstring error = L"Meter="; error += meter; - error += L" is not valid in section ["; + error += L" is not valid in ["; error += name; - error += L"]."; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); return NULL; } diff --git a/Library/MeterBar.cpp b/Library/MeterBar.cpp index a184ffe4..9f307e06 100644 --- a/Library/MeterBar.cpp +++ b/Library/MeterBar.cpp @@ -131,10 +131,10 @@ void CMeterBar::ReadConfig(CConfigParser& parser, const WCHAR* section) else { std::wstring error = L"BarOrientation=" + orientation; - error += L" is not valid in meter ["; + error += L" is not valid in ["; error += m_Name; - error += L"]."; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } if (m_Initialized) diff --git a/Library/MeterBitmap.cpp b/Library/MeterBitmap.cpp index 38bfc013..10e322f1 100644 --- a/Library/MeterBitmap.cpp +++ b/Library/MeterBitmap.cpp @@ -212,10 +212,10 @@ void CMeterBitmap::ReadConfig(CConfigParser& parser, const WCHAR* section) else { std::wstring error = L"BitmapAlign=" + align; - error += L" is not valid in meter ["; + error += L" is not valid in ["; error += m_Name; - error += L"]."; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } if (m_Initialized) diff --git a/Library/MeterHistogram.cpp b/Library/MeterHistogram.cpp index 9bbc7cff..1070e91a 100644 --- a/Library/MeterHistogram.cpp +++ b/Library/MeterHistogram.cpp @@ -529,7 +529,7 @@ void CMeterHistogram::BindMeasure(const std::list& measures) std::wstring error = L"The meter [" + m_Name; error += L"] cannot be bound with ["; error += m_SecondaryMeasureName; - error += L"]!"; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } } diff --git a/Library/MeterImage.cpp b/Library/MeterImage.cpp index e643356e..b4b5f40d 100644 --- a/Library/MeterImage.cpp +++ b/Library/MeterImage.cpp @@ -388,8 +388,8 @@ void CMeterImage::BindMeasure(const std::list& measures) std::wstring error = L"The meter [" + m_Name; error += L"] cannot be bound with ["; error += (*j); - error += L"]!"; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } } CMeter::SetAllMeasures(m_Measures); diff --git a/Library/MeterLine.cpp b/Library/MeterLine.cpp index e1a18121..de805c2a 100644 --- a/Library/MeterLine.cpp +++ b/Library/MeterLine.cpp @@ -377,8 +377,8 @@ void CMeterLine::BindMeasure(const std::list& measures) std::wstring error = L"The meter [" + m_Name; error += L"] cannot be bound with ["; error += (*j); - error += L"]!"; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } } CMeter::SetAllMeasures(m_Measures); diff --git a/Library/MeterString.cpp b/Library/MeterString.cpp index 05bde86f..700804d1 100644 --- a/Library/MeterString.cpp +++ b/Library/MeterString.cpp @@ -279,7 +279,7 @@ void CMeterString::Initialize() if (m_FontSize != 0) { std::wstring error = L"String: Unable to create font: " + m_FontFace; - throw CError(error, __LINE__, __FILE__); + throw CError(error); } } } @@ -378,10 +378,10 @@ void CMeterString::ReadConfig(CConfigParser& parser, const WCHAR* section) else { std::wstring error = L"StringAlign=" + align; - error += L" is not valid in meter ["; + error += L" is not valid in ["; error += m_Name; - error += L"]."; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } const std::wstring& stringCase = parser.ReadString(section, L"StringCase", L"NONE"); @@ -404,10 +404,10 @@ void CMeterString::ReadConfig(CConfigParser& parser, const WCHAR* section) else { std::wstring error = L"StringCase=" + stringCase; - error += L" is not valid in meter ["; + error += L" is not valid in ["; error += m_Name; - error += L"]."; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } const std::wstring& style = parser.ReadString(section, L"StringStyle", L"NORMAL"); @@ -430,10 +430,10 @@ void CMeterString::ReadConfig(CConfigParser& parser, const WCHAR* section) else { std::wstring error = L"StringStyle=" + style; - error += L" is not valid in meter ["; + error += L" is not valid in ["; error += m_Name; - error += L"]."; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } const std::wstring& effect = parser.ReadString(section, L"StringEffect", L"NONE"); @@ -452,10 +452,10 @@ void CMeterString::ReadConfig(CConfigParser& parser, const WCHAR* section) else { std::wstring error = L"StringEffect=" + effect; - error += L" is not valid in meter ["; + error += L" is not valid in ["; error += m_Name; - error += L"]."; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } if (m_Initialized && @@ -697,8 +697,8 @@ void CMeterString::BindMeasure(const std::list& measures) std::wstring error = L"The meter [" + m_Name; error += L"] cannot be bound with ["; error += (*j); - error += L"]!"; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } } CMeter::SetAllMeasures(m_Measures); diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 4beb3dc1..f8074755 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -255,7 +255,7 @@ int CMeterWindow::Initialize(CRainmeter& Rainmeter) if (err != 0 && ERROR_CLASS_ALREADY_EXISTS != err) { - throw CError(L"Unable to register class!", __LINE__, __FILE__); + throw CError(L"Unable to register class"); } } @@ -274,7 +274,7 @@ int CMeterWindow::Initialize(CRainmeter& Rainmeter) if (m_Window == NULL) { - throw CError(L"Unable to register window!", __LINE__, __FILE__); + throw CError(L"Unable to register window"); } setlocale(LC_NUMERIC, "C"); @@ -441,13 +441,13 @@ void CMeterWindow::Refresh(bool init, bool all) { if (0 == SetTimer(m_Window, TIMER_METER, m_WindowUpdate, NULL)) { - throw CError(L"Unable to set timer!", __LINE__, __FILE__); + throw CError(L"Unable to set timer"); } } if (0 == SetTimer(m_Window, TIMER_MOUSE, INTERVAL_MOUSE, NULL)) // Mouse position is checked twice per sec { - throw CError(L"Unable to set timer!", __LINE__, __FILE__); + throw CError(L"Unable to set timer"); } m_Rainmeter->SetCurrentParser(NULL); diff --git a/Library/TintedImage.cpp b/Library/TintedImage.cpp index c84c923c..2586f154 100644 --- a/Library/TintedImage.cpp +++ b/Library/TintedImage.cpp @@ -626,10 +626,10 @@ void CTintedImage::ReadConfig(CConfigParser& parser, const WCHAR* section) std::wstring error = m_ConfigArray[ConfigIndexImageCrop]; error += L"="; error += crop; - error += L" (origin) is not valid in meter ["; + error += L" (origin) is not valid in ["; error += section; - error += L"]."; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } } } @@ -734,10 +734,10 @@ void CTintedImage::ReadConfig(CConfigParser& parser, const WCHAR* section) std::wstring error = m_ConfigArray[ConfigIndexImageFlip]; error += L"="; error += flip; - error += L" is not valid in meter ["; + error += L" is not valid in ["; error += section; - error += L"]."; - throw CError(error, __LINE__, __FILE__); + error += L"]"; + throw CError(error); } if (!m_DisableTransform) diff --git a/Library/lua/glue/LuaMeterWindow.cpp b/Library/lua/glue/LuaMeterWindow.cpp index f50d96f1..339e5131 100644 --- a/Library/lua/glue/LuaMeterWindow.cpp +++ b/Library/lua/glue/LuaMeterWindow.cpp @@ -100,7 +100,6 @@ static int MeterWindow_GetMeter(lua_State* L) { std::wstring error = L"Script: No such meter as "; error += meterName; - error += L"."; Log(LOG_ERROR, error.c_str()); return 0; }