diff options
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); } } |