mirror of
https://github.com/allankoechke/SQLiteCpp.git
synced 2026-11-30 17:07:36 +00:00
Fix #73 Wrong exception thrown by Database constructor
- switched from sqlite3_errmsg() to sqlite3_errstr() where applicable
This commit is contained in:
@@ -195,7 +195,7 @@ bool Statement::executeStep()
|
||||
{
|
||||
mbOk = false;
|
||||
mbDone = false;
|
||||
throw SQLite::Exception(sqlite3_errmsg(mStmtPtr));
|
||||
throw SQLite::Exception(sqlite3_errstr(ret));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -227,7 +227,7 @@ int Statement::exec()
|
||||
{
|
||||
mbOk = false;
|
||||
mbDone = false;
|
||||
throw SQLite::Exception(sqlite3_errmsg(mStmtPtr));
|
||||
throw SQLite::Exception(sqlite3_errstr(ret));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -317,7 +317,7 @@ Statement::Ptr::Ptr(sqlite3* apSQLite, std::string& aQuery) :
|
||||
const int ret = sqlite3_prepare_v2(apSQLite, aQuery.c_str(), static_cast<int>(aQuery.size()), &mpStmt, NULL);
|
||||
if (SQLITE_OK != ret)
|
||||
{
|
||||
throw SQLite::Exception(sqlite3_errmsg(mpSQLite));
|
||||
throw SQLite::Exception(sqlite3_errstr(ret));
|
||||
}
|
||||
// Initialize the reference counter of the sqlite3_stmt :
|
||||
// used to share the mStmtPtr between Statement and Column objects;
|
||||
|
||||
Reference in New Issue
Block a user