Fix issue #7 : SQLITECPP_ENABLE_ASSERT_HANDLER

- SQLITECPP_ASSERT() can call a user defined SQLite::assertion_failed() handler.
This commit is contained in:
Sébastien Rombauts
2013-11-01 21:10:44 +01:00
parent 8bf7339e6b
commit ecd22dc112
10 changed files with 452 additions and 375 deletions

View File

@@ -11,6 +11,7 @@
#include "Transaction.h"
#include "Database.h"
#include "Assert.h"
#include "Exception.h"
@@ -35,11 +36,10 @@ Transaction::~Transaction(void) throw() // nothrow
{
mDatabase.exec("ROLLBACK");
}
catch (SQLite::Exception& /*e*/)
catch (SQLite::Exception& e)
{
// Never throw an exception in a destructor
//std::cout << e.what() << std::endl;
SQLITE_CPP_ASSERT(false);
SQLITECPP_ASSERT(false, e.what()); // See SQLITECPP_ENABLE_ASSERT_HANDLER
}
}
}