diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-03-18 14:17:42 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-03-18 14:18:26 +0200 |
commit | 3fb92c470f67162617704ad897cf90f73a18ac00 (patch) | |
tree | 5da4028fc38c96f97b2011b207ffd835d75d622f /odb/sqlite/error.cxx | |
parent | 7e88b0a80618848d3a3c5f6cad886c8b7785787d (diff) |
Add separate exception for SQLite forced rollbacks
Diffstat (limited to 'odb/sqlite/error.cxx')
-rw-r--r-- | odb/sqlite/error.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/odb/sqlite/error.cxx b/odb/sqlite/error.cxx index 74822d3..6107427 100644 --- a/odb/sqlite/error.cxx +++ b/odb/sqlite/error.cxx @@ -47,6 +47,15 @@ namespace odb m = "SQLite API misuse"; break; } +#ifdef SQLITE_ABORT_ROLLBACK + case SQLITE_ABORT: + { + if (ee == SQLITE_ABORT_ROLLBACK) + throw forced_rollback (); + + break; + } +#endif case SQLITE_LOCKED: { #ifdef LIBODB_SQLITE_HAVE_UNLOCK_NOTIFY @@ -65,16 +74,15 @@ namespace odb if (e != SQLITE_IOERR || ee == SQLITE_IOERR_BLOCKED) throw timeout (); #endif - - // Fall throught. - } - default: - { - m = sqlite3_errmsg (h); break; } + default: + break; } + if (m.empty ()) + m = sqlite3_errmsg (h); + throw database_exception (e, ee, m); } } |