Skip to content

Commit ffd4a85

Browse files
authored
Inherit std exception for CppSQLite3Exception (#14)
add noexcept and change to return cstr
1 parent 7c0d808 commit ffd4a85

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CppSQLite3.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <sqlite3.h>
1212
#include <cstdio>
1313
#include <cstring>
14+
#include <exception>
1415

1516
#define CPPSQLITE_ERROR 1000
1617

@@ -59,7 +60,7 @@ namespace detail
5960
}
6061

6162

62-
class CppSQLite3Exception
63+
class CppSQLite3Exception : public std::exception
6364
{
6465
public:
6566

@@ -75,6 +76,8 @@ class CppSQLite3Exception
7576

7677
const char* errorMessage() const { return mpszErrMess; }
7778

79+
const char* what() const noexcept override { return mpszErrMess; }
80+
7881
static const char* errorCodeAsString(int nErrCode);
7982

8083
private:

0 commit comments

Comments
 (0)