lib/sqlite: add "noexcept"
This commit is contained in:
parent
ff9759c09d
commit
fb01e41e8a
@ -24,13 +24,14 @@
|
||||
#include <string>
|
||||
|
||||
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) {}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user