MCPcopy Create free account
hub / github.com/SqliteModernCpp/sqlite_modern_cpp / sqlite_exception

Class sqlite_exception

hdr/sqlite_modern_cpp/errors.h:10–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace sqlite {
9
10 class sqlite_exception: public std::runtime_error {
11 public:
12 sqlite_exception(const char* msg, std::string sql, int code = -1): runtime_error(msg), code(code), sql(sql) {}
13 sqlite_exception(int code, std::string sql): runtime_error(sqlite3_errstr(code)), code(code), sql(sql) {}
14 int get_code() const {return code & 0xFF;}
15 int get_extended_code() const {return code;}
16 std::string get_sql() const {return sql;}
17 private:
18 int code;
19 std::string sql;
20 };
21
22 namespace errors {
23 //One more or less trivial derived error class for each SQLITE error.

Callers 2

throw_sqlite_errorFunction · 0.85
error_logFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected