aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/exceptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/pgsql/exceptions.cxx')
-rw-r--r--odb/pgsql/exceptions.cxx35
1 files changed, 33 insertions, 2 deletions
diff --git a/odb/pgsql/exceptions.cxx b/odb/pgsql/exceptions.cxx
index bea0870..bec4ba7 100644
--- a/odb/pgsql/exceptions.cxx
+++ b/odb/pgsql/exceptions.cxx
@@ -3,6 +3,8 @@
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
+#include <sstream>
+
#include <odb/pgsql/exceptions.hxx>
using namespace std;
@@ -12,12 +14,41 @@ namespace odb
namespace pgsql
{
//
+ // database_exception
+ //
+
+ database_exception::
+ database_exception (const string& message)
+ : message_ (message), what_ (message)
+ {
+ }
+
+ database_exception::
+ database_exception (const string& sqlstate,
+ const string& message)
+ : sqlstate_ (sqlstate), message_ (message)
+ {
+ what_ = sqlstate_ + ": " + message_;
+ }
+
+ database_exception::
+ ~database_exception () throw ()
+ {
+ }
+
+ const char* database_exception::
+ what () const throw ()
+ {
+ return what_.c_str ();
+ }
+
+ //
// cli_exception
//
cli_exception::
- cli_exception (const std::string& what)
- : what_ (what)
+ cli_exception (const string& w)
+ : what_ (w)
{
}