From 6eed6c47b07371349bd4c30daf2b305ff7f5b1d3 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Mon, 5 Sep 2011 11:55:41 +0200 Subject: Add exceptions and error translation --- odb/oracle/exceptions.hxx | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 odb/oracle/exceptions.hxx (limited to 'odb/oracle/exceptions.hxx') 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 +// 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 + +#include + +#include + +#include +#include + +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 + +#endif // ODB_ORACLE_EXCEPTIONS_HXX -- cgit v1.1