Revert use sqlite_errstr instead of sqlite3_errmsg that fixed #48

- sqlite3_errstr() is new from SQLite v3.7.15, not supported on Ubuntu 12.04
   which is what is used for continuous integration with Travis CI
 - Only case of error is SQLITE_BUSY: "database is locked" (some statements are not finalized)
   so use this generic string instead
This commit is contained in:
Sébastien Rombauts 2015-05-06 09:10:39 +02:00
parent 3ffc07b1c2
commit 318f742b5c

View File

@ -73,8 +73,9 @@ Database::Database(const std::string& aFilename,
Database::~Database() noexcept // nothrow
{
const int ret = sqlite3_close(mpSQLite);
// Never throw an exception in a destructor
SQLITECPP_ASSERT(SQLITE_OK == ret, sqlite3_errstr(ret)); // See SQLITECPP_ENABLE_ASSERT_HANDLER
// Only case of error is SQLITE_BUSY: "database is locked" (some statements are not finalized)
// Never throw an exception in a destructor :
SQLITECPP_ASSERT(SQLITE_OK == ret, "database is locked"); // See SQLITECPP_ENABLE_ASSERT_HANDLER
}
/**