You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -377,8 +377,8 @@ To support all possible values, you can use `variant<nullptr_t, sqlite_int64, do
377
377
Errors
378
378
----
379
379
380
-
On error, the library throws an error class indicating the type of error. The error classes are derived from the SQLITE3 error names, so if the error code is SQLITE_CONSTRAINT, the error class thrown is sqlite::exceptions::constraint. Note that all errors are derived from sqlite::sqlite_exception and that itself is derived from std::runtime_exception.
381
-
sqlite::sqlite_exception has a `get_code()` member function to get the SQLITE3 error code.
380
+
On error, the library throws an error class indicating the type of error. The error classes are derived from the SQLITE3 error names, so if the error code is SQLITE_CONSTRAINT, the error class thrown is sqlite::errors::constraint. SQLite3 extended error names are supported too. So there is e.g. a class sqlite::errors::constraint_primarykey derived from sqlite::errors::constraint. Note that all errors are derived from sqlite::sqlite_exception and that itself is derived from std::runtime_exception.
381
+
sqlite::sqlite_exception has a `get_code()` member function to get the SQLITE3 error code or `get_extended_code()` to get the extended error code.
382
382
Additionally you can use `get_sql()` to see the SQL statement leading to the error.
383
383
384
384
```c++
@@ -397,7 +397,9 @@ Additionally you can use `get_sql()` to see the SQL statement leading to the err
//Note these names are exact matches to the names of the SQLITE error codes.
59
-
classerror: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
60
-
classinternal: publicsqlite_exception{ using sqlite_exception::sqlite_exception; };
61
-
classperm: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
62
-
classabort: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
63
-
classbusy: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
64
-
classlocked: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
65
-
classnomem: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
66
-
classreadonly: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
67
-
classinterrupt: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
68
-
classioerr: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
69
-
classcorrupt: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
70
-
classnotfound: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
71
-
classfull: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
72
-
classcantopen: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
73
-
classprotocol: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
74
-
classempty: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
75
-
classschema: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
76
-
classtoobig: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
77
-
classconstraint: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
78
-
classmismatch: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
79
-
classmisuse: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
80
-
classnolfs: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
81
-
classauth: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
82
-
classformat: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
83
-
classrange: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
84
-
classnotadb: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
85
-
86
-
//Some additional errors are here for the C++ interface
87
-
classmore_rows: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
88
-
classno_rows: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
89
-
classreexecution: publicsqlite_exception { using sqlite_exception::sqlite_exception; }; // Prepared statements need to be reset before calling them again
90
-
classmore_statements: publicsqlite_exception { using sqlite_exception::sqlite_exception; }; // Prepared statements can only contain one statement
classbase ## _ ## sub: public base { using base::base; };
33
+
#include"lists/error_codes.h"
34
+
#undef SQLITE_MODERN_CPP_ERROR_CODE_EXTENDED
35
+
#undef SQLITE_MODERN_CPP_ERROR_CODE
36
+
37
+
//Some additional errors are here for the C++ interface
38
+
classmore_rows: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
39
+
classno_rows: publicsqlite_exception { using sqlite_exception::sqlite_exception; };
40
+
classreexecution: publicsqlite_exception { using sqlite_exception::sqlite_exception; }; // Prepared statements need to be reset before calling them again
41
+
classmore_statements: publicsqlite_exception { using sqlite_exception::sqlite_exception; }; // Prepared statements can only contain one statement
0 commit comments