aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/exceptions.hxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-05-06 11:44:02 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-05-09 16:52:07 +0200
commit74d9ab3518d50ebafb12e8252c01fa904b089481 (patch)
tree456be9c02055d01f27614bf6cb204f0c78c2a848 /odb/pgsql/exceptions.hxx
parent77bbae6038d20576a4807ed8ca834685a1e85afa (diff)
Add error support
Diffstat (limited to 'odb/pgsql/exceptions.hxx')
-rw-r--r--odb/pgsql/exceptions.hxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/odb/pgsql/exceptions.hxx b/odb/pgsql/exceptions.hxx
index 0ceb83c..d6cae70 100644
--- a/odb/pgsql/exceptions.hxx
+++ b/odb/pgsql/exceptions.hxx
@@ -20,6 +20,36 @@ namespace odb
{
namespace pgsql
{
+ struct LIBODB_PGSQL_EXPORT database_exception: odb::database_exception
+ {
+ database_exception (const std::string& message);
+
+ database_exception (const std::string& sqlstate,
+ const std::string& message);
+
+ ~database_exception () throw ();
+
+ const std::string&
+ message () const
+ {
+ return message_;
+ }
+
+ const std::string&
+ sqlstate () const
+ {
+ return sqlstate_;
+ }
+
+ virtual const char*
+ what () const throw ();
+
+ private:
+ std::string sqlstate_;
+ std::string message_;
+ std::string what_;
+ };
+
struct LIBODB_PGSQL_EXPORT cli_exception: odb::exception
{
cli_exception (const std::string& what);