diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-09-05 11:55:41 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-09-05 11:55:41 +0200 |
commit | 6eed6c47b07371349bd4c30daf2b305ff7f5b1d3 (patch) | |
tree | a9e63048560e301a1415c8d9821d2715423a94aa /odb/oracle/exceptions.hxx | |
parent | f024d16b9c78d683baa5d87b6e92b3d79a1f3300 (diff) |
Add exceptions and error translation
Diffstat (limited to 'odb/oracle/exceptions.hxx')
-rw-r--r-- | odb/oracle/exceptions.hxx | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/odb/oracle/exceptions.hxx b/odb/oracle/exceptions.hxx new file mode 100644 index 0000000..ae5a0e7 --- /dev/null +++ b/odb/oracle/exceptions.hxx @@ -0,0 +1,70 @@ +// file : odb/oracle/exceptions.hxx +// author : Constantin Michael <constantin@codesynthesis.com> +// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// license : ODB NCUEL; see accompanying LICENSE file + +#ifndef ODB_ORACLE_EXCEPTIONS_HXX +#define ODB_ORACLE_EXCEPTIONS_HXX + +#include <odb/pre.hxx> + +#include <string> + +#include <odb/exceptions.hxx> + +#include <odb/oracle/version.hxx> +#include <odb/oracle/details/export.hxx> + +namespace odb +{ + namespace oracle + { + struct LIBODB_ORACLE_EXPORT database_exception: odb::database_exception + { + database_exception (int error, const std::string& message); + + ~database_exception () throw (); + + int + error () const + { + return error_; + } + + const std::string& + message () const + { + return message_; + } + + virtual const char* + what () const throw (); + + private: + int error_; + std::string message_; + }; + + struct LIBODB_ORACLE_EXPORT cli_exception: odb::exception + { + cli_exception (const std::string& what); + ~cli_exception () throw (); + + virtual const char* + what () const throw (); + + private: + std::string what_; + }; + + struct LIBODB_ORACLE_EXPORT invalid_oci_handle: odb::exception + { + virtual const char* + what () const throw (); + }; + } +} + +#include <odb/post.hxx> + +#endif // ODB_ORACLE_EXCEPTIONS_HXX |