diff options
-rw-r--r-- | odb/exceptions.cxx | 12 | ||||
-rw-r--r-- | odb/exceptions.hxx | 21 |
2 files changed, 32 insertions, 1 deletions
diff --git a/odb/exceptions.cxx b/odb/exceptions.cxx index 27a0e8b..1d4be70 100644 --- a/odb/exceptions.cxx +++ b/odb/exceptions.cxx @@ -55,6 +55,18 @@ namespace odb return "transaction aborted due to deadlock"; } + const char* connection_lost:: + what () const throw () + { + return "connection to database lost"; + } + + const char* timeout:: + what () const throw () + { + return "database operation timeout"; + } + const char* object_not_persistent:: what () const throw () { diff --git a/odb/exceptions.hxx b/odb/exceptions.hxx index 362c7b0..1185876 100644 --- a/odb/exceptions.hxx +++ b/odb/exceptions.hxx @@ -62,7 +62,23 @@ namespace odb // Database operations exceptions. // - struct LIBODB_EXPORT deadlock: exception + struct LIBODB_EXPORT recoverable: exception + { + }; + + struct LIBODB_EXPORT connection_lost: recoverable + { + virtual const char* + what () const throw (); + }; + + struct LIBODB_EXPORT timeout: recoverable + { + virtual const char* + what () const throw (); + }; + + struct LIBODB_EXPORT deadlock: recoverable { virtual const char* what () const throw (); @@ -102,7 +118,10 @@ namespace odb using odb::not_in_session; using odb::const_object; + using odb::recoverable; using odb::deadlock; + using odb::connection_lost; + using odb::timeout; using odb::object_not_persistent; using odb::object_already_persistent; using odb::result_not_cached; |