aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/exceptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/sqlite/exceptions.cxx')
-rw-r--r--odb/sqlite/exceptions.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/odb/sqlite/exceptions.cxx b/odb/sqlite/exceptions.cxx
index 6801665..6bd8bb8 100644
--- a/odb/sqlite/exceptions.cxx
+++ b/odb/sqlite/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/sqlite/exceptions.hxx>
using namespace std;
@@ -24,12 +26,20 @@ namespace odb
database_exception (int e, int ee, const string& m)
: error_ (e), extended_error_ (ee), message_ (m)
{
+ ostringstream ostr;
+ ostr << error_;
+
+ if (error_ != extended_error_)
+ ostr << " (" << extended_error_ << ")";
+
+ ostr << ": " << message_;
+ what_ = ostr.str ();
}
const char* database_exception::
what () const throw ()
{
- return message_.c_str ();
+ return what_.c_str ();
}
//