Commit fb01e41e authored by Max Kellermann's avatar Max Kellermann

lib/sqlite: add "noexcept"

parent ff9759c0
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment