Fix #73 Wrong exception thrown by Database constructor

- switched from sqlite3_errmsg() to sqlite3_errstr() where applicable
This commit is contained in:
Sébastien Rombauts
2015-11-10 18:32:24 +01:00
parent 24153e5293
commit b7b440de5d
5 changed files with 9 additions and 13 deletions

View File

@@ -85,11 +85,7 @@ int Backup::executeStep(const int aNumPage /* = -1 */)
if (SQLITE_OK != res && SQLITE_DONE != res &&
SQLITE_BUSY != res && SQLITE_LOCKED != res)
{
std::string strerr("Backup executeStep error");
#if SQLITE_VERSION_NUMBER >= 3007015 // SQLite v3.7.15 is the first version with sqlite3_errstr() interface
strerr += "with error message ";
strerr += sqlite3_errstr(res);
#endif
std::string strerr = sqlite3_errstr(res);
throw SQLite::Exception(strerr);
}
return res;