Index: src/libchcore/TSQLiteDatabase.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r8d3154738b885f2e01997071e6180da0c4b8cc7c --- src/libchcore/TSQLiteDatabase.cpp (.../TSQLiteDatabase.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSQLiteDatabase.cpp (.../TSQLiteDatabase.cpp) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) @@ -35,7 +35,7 @@ if (iResult != SQLITE_OK) { const wchar_t* pszMsg = (const wchar_t*)sqlite3_errmsg16(m_pDBHandle); - THROW_SQLITE_EXCEPTION(eErr_SQLiteCannotOpenDatabase, iResult, pszMsg); + throw TSQLiteException(eErr_SQLiteCannotOpenDatabase, iResult, pszMsg, LOCATION); } } Index: src/libchcore/TSQLiteException.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r8d3154738b885f2e01997071e6180da0c4b8cc7c --- src/libchcore/TSQLiteException.h (.../TSQLiteException.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSQLiteException.h (.../TSQLiteException.h) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) @@ -22,9 +22,6 @@ #include "libchcore.h" #include "TBaseException.h" -#define THROW_SQLITE_EXCEPTION(error_code, sqlite_error_code, err_msg)\ - throw TSQLiteException(error_code, sqlite_error_code, err_msg, __FILEW__, __LINE__, __FUNCTIONW__) - namespace chcore { namespace sqlite Index: src/libchcore/TSQLiteSerializerContainer.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r8d3154738b885f2e01997071e6180da0c4b8cc7c --- src/libchcore/TSQLiteSerializerContainer.cpp (.../TSQLiteSerializerContainer.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSQLiteSerializerContainer.cpp (.../TSQLiteSerializerContainer.cpp) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) @@ -57,7 +57,7 @@ { void* pMemoryBlock = GetPool().malloc(); if (!pMemoryBlock) - THROW_SERIALIZER_EXCEPTION(eErr_InternalProblem, _T("Cannot allocate memory")); + throw TSerializerException(eErr_InternalProblem, _T("Cannot allocate memory"), LOCATION); iterFnd = m_mapRows.insert(std::make_pair(oidRowID, TSQLiteSerializerRowData(oidRowID, m_tColumns, bMarkAsAdded, (unsigned long long*)pMemoryBlock, GetPool().get_requested_size(), m_poolStrings))).first; } @@ -177,7 +177,7 @@ else { if (m_pPoolRows->get_requested_size() != CalculateRowMemorySize()) - THROW_SERIALIZER_EXCEPTION(eErr_InternalProblem, _T("Column count changed after first use")); + throw TSerializerException(eErr_InternalProblem, _T("Column count changed after first use"), LOCATION); } return *m_pPoolRows; Index: src/libchcore/TSQLiteSerializerRowData.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r8d3154738b885f2e01997071e6180da0c4b8cc7c --- src/libchcore/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) @@ -34,9 +34,9 @@ m_poolStrings(poolStrings) { if (!m_pPoolMemory) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Null memory provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Null memory provided"), LOCATION); if (rColumnDefinition.GetCount() > 63) - THROW_SERIALIZER_EXCEPTION(eErr_InternalProblem, _T("Serializer supports up to 63 columns. If more is needed the block header needs to be increased.")); + throw TSerializerException(eErr_InternalProblem, _T("Serializer supports up to 63 columns. If more is needed the block header needs to be increased."), LOCATION); // initialize memory memset((void*)pPoolMemory, 0, stPoolMemorySizeInBytes); @@ -63,7 +63,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, bool bValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_bool) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); ModifyColumnData(stColIndex) = (bValue ? 1ULL : 0ULL); return *this; @@ -72,7 +72,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, short siValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_short) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); ModifyColumnData(stColIndex) = (unsigned long long)*(unsigned short*)&siValue; return *this; @@ -81,7 +81,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, unsigned short usiValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_ushort) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); ModifyColumnData(stColIndex) = (unsigned long long)usiValue; return *this; @@ -90,7 +90,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, int iValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_int) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); ModifyColumnData(stColIndex) = (unsigned long long)*(unsigned int*)&iValue; return *this; @@ -99,7 +99,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, unsigned int uiValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_uint) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); ModifyColumnData(stColIndex) = (unsigned long long)uiValue; return *this; @@ -108,7 +108,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, long lValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_long) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); ModifyColumnData(stColIndex) = (unsigned long long)*(unsigned long*)&lValue; return *this; @@ -117,7 +117,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, unsigned long ulValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_ulong) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); ModifyColumnData(stColIndex) = (unsigned long long)ulValue; return *this; @@ -126,7 +126,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, long long llValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_longlong) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); ModifyColumnData(stColIndex) = *(unsigned long long*)&llValue; return *this; @@ -135,7 +135,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, unsigned long long ullValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_ulonglong) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); ModifyColumnData(stColIndex) = ullValue; return *this; @@ -144,7 +144,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, double dValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_double) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); BOOST_STATIC_ASSERT(sizeof(double) == sizeof(unsigned long long)); ModifyColumnData(stColIndex) = *(unsigned long long*)&dValue; @@ -154,7 +154,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, const TString& strValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_string) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); if (strValue.IsEmpty()) ModifyColumnData(stColIndex) = (unsigned long long)0; @@ -170,7 +170,7 @@ ISerializerRowData& TSQLiteSerializerRowData::SetValue(size_t stColIndex, const TSmartPath& pathValue) { if (m_rColumns.GetColumnType(stColIndex) != IColumnsDefinition::eType_path) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid argument type provided")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid argument type provided"), LOCATION); if (pathValue.IsEmpty()) ModifyColumnData(stColIndex) = (unsigned long long)0; @@ -270,7 +270,7 @@ int iChanges = tStatement.Changes(); _ASSERTE(iChanges == 1); if (iChanges != 1) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidData, _T("Update query did not update record in the database")); + throw TSerializerException(eErr_InvalidData, _T("Update query did not update record in the database"), LOCATION); } } @@ -354,7 +354,7 @@ void TSQLiteSerializerRowData::MarkColumnUsage(size_t stIndex, bool bUsed) { if (stIndex >= m_rColumns.GetCount()) - THROW_SERIALIZER_EXCEPTION(eErr_BoundsExceeded, _T("Wrong column provided")); + throw TSerializerException(eErr_BoundsExceeded, _T("Wrong column provided"), LOCATION); unsigned long long ullMask = 2ULL << stIndex; if (bUsed) @@ -487,7 +487,7 @@ } default: - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("Invalid type")); + throw TSerializerException(eErr_InvalidArgument, _T("Invalid type"), LOCATION); } } } Index: src/libchcore/TSQLiteStatement.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r8d3154738b885f2e01997071e6180da0c4b8cc7c --- src/libchcore/TSQLiteStatement.cpp (.../TSQLiteStatement.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSQLiteStatement.cpp (.../TSQLiteStatement.cpp) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) @@ -33,7 +33,7 @@ m_bHasRow(false) { if (!m_spDatabase) - THROW_SQLITE_EXCEPTION(eErr_InvalidArgument, 0, _T("Invalid database provided")); + throw TSQLiteException(eErr_InvalidArgument, 0, _T("Invalid database provided"), LOCATION); } TSQLiteStatement::~TSQLiteStatement() @@ -49,7 +49,7 @@ { int iResult = sqlite3_finalize(m_pStatement); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLiteFinalizeError, iResult, _T("Cannot finalize statement")); + throw TSQLiteException(eErr_SQLiteFinalizeError, iResult, _T("Cannot finalize statement"), LOCATION); m_pStatement = NULL; } m_bHasRow = false; @@ -61,15 +61,15 @@ int iResult = sqlite3_prepare16_v2((sqlite3*)m_spDatabase->GetHandle(), pszQuery, -1, &m_pStatement, NULL); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLitePrepareError, iResult, (PCTSTR)sqlite3_errmsg16((sqlite3*)m_spDatabase->GetHandle())); + throw TSQLiteException(eErr_SQLitePrepareError, iResult, (PCTSTR)sqlite3_errmsg16((sqlite3*)m_spDatabase->GetHandle()), LOCATION); } TSQLiteStatement::EStepResult TSQLiteStatement::Step() { m_bHasRow = false; if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); int iResult = sqlite3_step(m_pStatement); switch (iResult) @@ -87,7 +87,7 @@ const size_t stMaxSize = 1024; wchar_t szText[stMaxSize]; _snwprintf_s(szText, stMaxSize, _TRUNCATE, L"Cannot perform step on the statement. SQLite reported error: %s", pszErrMsg); - THROW_SQLITE_EXCEPTION(eErr_SQLiteStepError, iResult, szText); + throw TSQLiteException(eErr_SQLiteStepError, iResult, szText, LOCATION); } } } @@ -115,11 +115,11 @@ void TSQLiteStatement::BindValue(int iColumn, int iValue) { if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); int iResult = sqlite3_bind_int(m_pStatement, iColumn, iValue); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLiteBindError, iResult, _T("Cannot bind a parameter")); + throw TSQLiteException(eErr_SQLiteBindError, iResult, _T("Cannot bind a parameter"), LOCATION); } void TSQLiteStatement::BindValue(int iColumn, unsigned int uiValue) @@ -140,11 +140,11 @@ void TSQLiteStatement::BindValue(int iColumn, long long llValue) { if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); int iResult = sqlite3_bind_int64(m_pStatement, iColumn, llValue); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLiteBindError, iResult, _T("Cannot bind a parameter")); + throw TSQLiteException(eErr_SQLiteBindError, iResult, _T("Cannot bind a parameter"), LOCATION); } void TSQLiteStatement::BindValue(int iColumn, unsigned long long ullValue) @@ -155,21 +155,21 @@ void TSQLiteStatement::BindValue(int iColumn, double dValue) { if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); int iResult = sqlite3_bind_double(m_pStatement, iColumn, dValue); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLiteBindError, iResult, _T("Cannot bind a parameter")); + throw TSQLiteException(eErr_SQLiteBindError, iResult, _T("Cannot bind a parameter"), LOCATION); } void TSQLiteStatement::BindValue(int iColumn, PCTSTR pszText) { if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); int iResult = sqlite3_bind_text16(m_pStatement, iColumn, pszText, -1, SQLITE_TRANSIENT); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLiteBindError, iResult, _T("Cannot bind a parameter")); + throw TSQLiteException(eErr_SQLiteBindError, iResult, _T("Cannot bind a parameter"), LOCATION); } void TSQLiteStatement::BindValue(int iColumn, const TString& strText) @@ -200,9 +200,9 @@ int TSQLiteStatement::GetInt(int iCol) { if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); if (!m_bHasRow) - THROW_SQLITE_EXCEPTION(eErr_SQLiteNoRowAvailable, 0, _T("No row available")); + throw TSQLiteException(eErr_SQLiteNoRowAvailable, 0, _T("No row available"), LOCATION); return sqlite3_column_int(m_pStatement, iCol); } @@ -226,9 +226,9 @@ long long TSQLiteStatement::GetInt64(int iCol) { if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); if (!m_bHasRow) - THROW_SQLITE_EXCEPTION(eErr_SQLiteNoRowAvailable, 0, _T("No row available")); + throw TSQLiteException(eErr_SQLiteNoRowAvailable, 0, _T("No row available"), LOCATION); return sqlite3_column_int64(m_pStatement, iCol); } @@ -242,19 +242,19 @@ double TSQLiteStatement::GetDouble(int iCol) { if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); if (!m_bHasRow) - THROW_SQLITE_EXCEPTION(eErr_SQLiteNoRowAvailable, 0, _T("No row available")); + throw TSQLiteException(eErr_SQLiteNoRowAvailable, 0, _T("No row available"), LOCATION); return sqlite3_column_double(m_pStatement, iCol); } TString TSQLiteStatement::GetText(int iCol) { if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); if (!m_bHasRow) - THROW_SQLITE_EXCEPTION(eErr_SQLiteNoRowAvailable, 0, _T("No row available")); + throw TSQLiteException(eErr_SQLiteNoRowAvailable, 0, _T("No row available"), LOCATION); return TString((const wchar_t*)sqlite3_column_text16(m_pStatement, iCol)); } @@ -267,21 +267,21 @@ void TSQLiteStatement::ClearBindings() { if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); int iResult = sqlite3_clear_bindings(m_pStatement); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLiteBindError, iResult, _T("Cannot clear bindings")); + throw TSQLiteException(eErr_SQLiteBindError, iResult, _T("Cannot clear bindings"), LOCATION); } void TSQLiteStatement::Reset() { if (!m_pStatement) - THROW_SQLITE_EXCEPTION(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement")); + throw TSQLiteException(eErr_SQLiteStatementNotPrepared, 0, _T("Tried to step on unprepared statement"), LOCATION); int iResult = sqlite3_reset(m_pStatement); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLiteBindError, iResult, _T("Cannot reset statement")); + throw TSQLiteException(eErr_SQLiteBindError, iResult, _T("Cannot reset statement"), LOCATION); } void TSQLiteStatement::GetValue(int iCol, bool& bValue) Index: src/libchcore/TSQLiteTransaction.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r8d3154738b885f2e01997071e6180da0c4b8cc7c --- src/libchcore/TSQLiteTransaction.cpp (.../TSQLiteTransaction.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSQLiteTransaction.cpp (.../TSQLiteTransaction.cpp) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) @@ -31,7 +31,7 @@ m_bTransactionStarted(false) { if (!m_spDatabase) - THROW_SQLITE_EXCEPTION(eErr_InvalidArgument, 0, _T("Invalid database provided")); + throw TSQLiteException(eErr_InvalidArgument, 0, _T("Invalid database provided"), LOCATION); Begin(); } @@ -53,11 +53,11 @@ return; if (m_bTransactionStarted) - THROW_SQLITE_EXCEPTION(eErr_SQLiteCannotBeginTransaction, 0, _T("Transaction already started")); + throw TSQLiteException(eErr_SQLiteCannotBeginTransaction, 0, _T("Transaction already started"), LOCATION); int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "BEGIN TRANSACTION", NULL, NULL, NULL); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLiteCannotBeginTransaction, iResult, _T("Cannot begin transaction")); + throw TSQLiteException(eErr_SQLiteCannotBeginTransaction, iResult, _T("Cannot begin transaction"), LOCATION); m_spDatabase->SetInTransaction(true); m_bTransactionStarted = true; @@ -67,15 +67,15 @@ { // no transactions whatsoever (even on database) if (!m_bTransactionStarted && !m_spDatabase->GetInTransaction()) - THROW_SQLITE_EXCEPTION(eErr_SQLiteCannotRollbackTransaction, 0, _T("Transaction not started")); + throw TSQLiteException(eErr_SQLiteCannotRollbackTransaction, 0, _T("Transaction not started"), LOCATION); // database has transaction started, but not by this object if (!m_bTransactionStarted) return; int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "ROLLBACK TRANSACTION;", NULL, NULL, NULL); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLiteCannotRollbackTransaction, iResult, _T("Cannot rollback transaction")); + throw TSQLiteException(eErr_SQLiteCannotRollbackTransaction, iResult, _T("Cannot rollback transaction"), LOCATION); m_spDatabase->SetInTransaction(false); m_bTransactionStarted = false; } @@ -84,15 +84,15 @@ { // no transactions whatsoever (even on database) if (!m_bTransactionStarted && !m_spDatabase->GetInTransaction()) - THROW_SQLITE_EXCEPTION(eErr_SQLiteCannotRollbackTransaction, 0, _T("Transaction not started")); + throw TSQLiteException(eErr_SQLiteCannotRollbackTransaction, 0, _T("Transaction not started"), LOCATION); // database has transaction started, but not by this object if (!m_bTransactionStarted) return; int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "COMMIT TRANSACTION;", NULL, NULL, NULL); if (iResult != SQLITE_OK) - THROW_SQLITE_EXCEPTION(eErr_SQLiteCannotCommitTransaction, iResult, _T("Cannot commit transaction")); + throw TSQLiteException(eErr_SQLiteCannotCommitTransaction, iResult, _T("Cannot commit transaction"), LOCATION); m_spDatabase->SetInTransaction(false); m_bTransactionStarted = false; } Index: src/libchcore/TSerializerException.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r8d3154738b885f2e01997071e6180da0c4b8cc7c --- src/libchcore/TSerializerException.h (.../TSerializerException.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSerializerException.h (.../TSerializerException.h) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) @@ -22,12 +22,9 @@ #include "libchcore.h" #include "TBaseException.h" -#define THROW_SERIALIZER_EXCEPTION(error_code, err_msg)\ - throw TSerializerException(error_code, err_msg, __FILEW__, __LINE__, __FUNCTIONW__) - namespace chcore { - class TSerializerException : public TBaseException + class LIBCHCORE_API TSerializerException : public TBaseException { public: TSerializerException(EGeneralErrors eErrorCode, const wchar_t* pszMsg, const wchar_t* pszFile, size_t stLineNumber, const wchar_t* pszFunction); Index: src/libchcore/TSerializerVersion.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r8d3154738b885f2e01997071e6180da0c4b8cc7c --- src/libchcore/TSerializerVersion.cpp (.../TSerializerVersion.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSerializerVersion.cpp (.../TSerializerVersion.cpp) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) @@ -34,7 +34,7 @@ m_bSetupExecuted(false) { if (!spDatabase) - THROW_SERIALIZER_EXCEPTION(eErr_InvalidArgument, _T("No database provided")); + throw TSerializerException(eErr_InvalidArgument, _T("No database provided"), LOCATION); } TSerializerVersion::~TSerializerVersion() @@ -53,7 +53,7 @@ tStatement.BindValue(1, _T("table")); tStatement.BindValue(2, _T("version")); if (tStatement.Step() != TSQLiteStatement::eStep_HasRow) - THROW_SQLITE_EXCEPTION(eErr_InternalProblem, SQLITE_ERROR, _T("Problem accessing sqlite_master table")); + throw TSQLiteException(eErr_InternalProblem, SQLITE_ERROR, _T("Problem accessing sqlite_master table"), LOCATION); int iVersionCount = tStatement.GetInt(0); if (iVersionCount == 0) Index: src/libchcore/TString.cpp =================================================================== diff -u -re8f31b0f922b402878356e130c866c4f3682a7f5 -r8d3154738b885f2e01997071e6180da0c4b8cc7c --- src/libchcore/TString.cpp (.../TString.cpp) (revision e8f31b0f922b402878356e130c866c4f3682a7f5) +++ src/libchcore/TString.cpp (.../TString.cpp) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) @@ -65,15 +65,15 @@ { // we support either both arguments != NULL or both == NULL if (pszEnd != NULL && pszStart == NULL || pszEnd == NULL && pszStart != NULL) - THROW_STRING_EXCEPTION(eErr_InvalidArgument, _T("End of string specified while start is NULL")); + throw TStringException(eErr_InvalidArgument, _T("End of string specified while start is NULL"), LOCATION); // sanity check if (pszEnd < pszStart) - THROW_STRING_EXCEPTION(eErr_InvalidArgument, _T("Paradox: string begins after its end")); + throw TStringException(eErr_InvalidArgument, _T("Paradox: string begins after its end"), LOCATION); size_t stCount = pszEnd - pszStart; if (stCount > stMaxStringSize) - THROW_STRING_EXCEPTION(eErr_InvalidArgument, _T("Exceeded maximum expected string size")); + throw TStringException(eErr_InvalidArgument, _T("Exceeded maximum expected string size"), LOCATION); SetString(pszStart, stCount); } @@ -83,7 +83,7 @@ m_stBufferSize(0) { if (!pszStart) - THROW_STRING_EXCEPTION(eErr_InvalidArgument, _T("String not specified")); + throw TStringException(eErr_InvalidArgument, _T("String not specified"), LOCATION); if (stCount == 0) return; Index: src/libchcore/TStringException.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r8d3154738b885f2e01997071e6180da0c4b8cc7c --- src/libchcore/TStringException.h (.../TStringException.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TStringException.h (.../TStringException.h) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) @@ -23,9 +23,6 @@ #include "ErrorCodes.h" #include "TBaseException.h" -#define THROW_STRING_EXCEPTION(error_code, err_msg)\ - throw TStringException(error_code, err_msg, __FILEW__, __LINE__, __FUNCTIONW__) - namespace chcore { class LIBCHCORE_API TStringException : public TBaseException