diff --git a/src/lib/sqlite/Error.cxx b/src/lib/sqlite/Error.cxx index 0d5cfd963..53962b991 100644 --- a/src/lib/sqlite/Error.cxx +++ b/src/lib/sqlite/Error.cxx @@ -24,13 +24,14 @@ #include static std::string -MakeSqliteErrorMessage(sqlite3 *db, const char *msg) +MakeSqliteErrorMessage(sqlite3 *db, const char *msg) noexcept { return std::string(msg) + ": " + sqlite3_errmsg(db); } -SqliteError::SqliteError(sqlite3 *db, int _code, const char *msg) +SqliteError::SqliteError(sqlite3 *db, int _code, const char *msg) noexcept :std::runtime_error(MakeSqliteErrorMessage(db, msg)), code(_code) {} -SqliteError::SqliteError(sqlite3_stmt *stmt, int _code, const char *msg) +SqliteError::SqliteError(sqlite3_stmt *stmt, int _code, + const char *msg) noexcept :SqliteError(sqlite3_db_handle(stmt), _code, msg) {} diff --git a/src/lib/sqlite/Error.hxx b/src/lib/sqlite/Error.hxx index 5930a7f87..f95592fc2 100644 --- a/src/lib/sqlite/Error.hxx +++ b/src/lib/sqlite/Error.hxx @@ -29,8 +29,8 @@ class SqliteError final : public std::runtime_error { int code; public: - SqliteError(sqlite3 *db, int _code, const char *msg); - SqliteError(sqlite3_stmt *stmt, int _code, const char *msg); + SqliteError(sqlite3 *db, int _code, const char *msg) noexcept; + SqliteError(sqlite3_stmt *stmt, int _code, const char *msg) noexcept; int GetCode() const { return code;