aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/error.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-03-18 14:13:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-03-18 14:13:37 +0200
commit43904af47c138feea6a5c6e04756c70bb2e41de7 (patch)
tree8445e04cf5d7afa222d68704530a72a48f86a7ba /odb/sqlite/error.cxx
parentb580f1548ff335a0e1fa004fc6626486535c94e1 (diff)
Add separate exception for SQLite forced rollbacks
Diffstat (limited to 'odb/sqlite/error.cxx')
-rw-r--r--odb/sqlite/error.cxx20
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);
}
}