aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/exceptions.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-09-05 11:55:41 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-09-05 11:55:41 +0200
commit6eed6c47b07371349bd4c30daf2b305ff7f5b1d3 (patch)
treea9e63048560e301a1415c8d9821d2715423a94aa /odb/oracle/exceptions.cxx
parentf024d16b9c78d683baa5d87b6e92b3d79a1f3300 (diff)
Add exceptions and error translation
Diffstat (limited to 'odb/oracle/exceptions.cxx')
-rw-r--r--odb/oracle/exceptions.cxx66
1 files changed, 66 insertions, 0 deletions
diff --git a/odb/oracle/exceptions.cxx b/odb/oracle/exceptions.cxx
new file mode 100644
index 0000000..903608e
--- /dev/null
+++ b/odb/oracle/exceptions.cxx
@@ -0,0 +1,66 @@
+// file : odb/oracle/exceptions.cxx
+// author : Constantin Michael <constantin@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : ODB NCUEL; see accompanying LICENSE file
+
+#include <odb/oracle/exceptions.hxx>
+
+using namespace std;
+
+namespace odb
+{
+ namespace oracle
+ {
+ //
+ // database_exception
+ //
+
+ database_exception::
+ database_exception (int error, const string& message)
+ : error_ (error), message_ (message)
+ {
+ }
+
+ database_exception::
+ ~database_exception () throw ()
+ {
+ }
+
+ const char* database_exception::
+ what () const throw ()
+ {
+ return message_.c_str ();
+ }
+
+ //
+ // cli_exception
+ //
+
+ cli_exception::
+ cli_exception (const string& what)
+ : what_ (what)
+ {
+ }
+
+ cli_exception::
+ ~cli_exception () throw ()
+ {
+ }
+
+ const char* cli_exception::
+ what () const throw ()
+ {
+ return what_.c_str ();
+ }
+
+ //
+ // invalid_oci_handle
+ //
+
+ const char* invalid_oci_handle::
+ what () const throw ()
+ {
+ return "invalid oci handle";
+ }
+ }
+}