ocilib::Exception Class Reference

Exception class handling all OCILIB errors. More...

`#include <ocilib.hpp>`

Inherits std::exception.

## Public Types

enum | ExceptionTypeValues { OracleError = OCI_ERR_ORACLE, OcilibError = OCI_ERR_OCILIB, OracleWarning = OCI_ERR_WARNING }
| Exception type enumerated values. More...
typedef Enum< ExceptionTypeValues > | ExceptionType
| Type of Exception. More...

## Public Member Functions

ostring | GetMessage () const
| Retrieve the error message.
ExceptionType | GetType () const
| Return the Exception type.
int | GetOracleErrorCode () const
| Return the Oracle error code.
int | GetInternalErrorCode () const
| Return the OCILIB error code.
Statement | GetStatement () const
| Return the statement within the error occurred.
Connection | GetConnection () const
| Return the connection within the error occurred.
unsigned int | GetRow () const
| Return the row index which caused an error during statement execution. More...
const char * | what () const override throw ()
| Override the std::exception::what() method. More...
virtual | ~Exception () throw ()
| Virtual destructor required for deriving from std::exception.

## Friends

template<class T >
T | Check (T result)
| Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.

## Detailed Description

Exception class handling all OCILIB errors.

This class wraps the OCILIB object handle OCI_Error and its related methods

Definition at line 485 of file ocilib.hpp.

## Member Typedef Documentation

## ExceptionType

typedef Enum<ExceptionTypeValues> ocilib::Exception::ExceptionType

Type of Exception.

Possible values are Exception::ExceptionTypeValues

Definition at line 515 of file ocilib.hpp.

## Member Enumeration Documentation

## ExceptionTypeValues

enum ocilib::Exception::ExceptionTypeValues

Exception type enumerated values.

Enumerator
OracleError | Exception caused by an Oracle error
OcilibError | Exception caused by an Ocilib error
OracleWarning | Exception caused by an Oracle Warning

Definition at line 498 of file ocilib.hpp.

## Member Function Documentation

## GetRow()

unsigned int ocilib::Exception::GetRow | ( |  | ) | const

inline

Return the row index which caused an error during statement execution.

Warning
  Row index start at 1.

Returns
  - 0 if the error is not related to array DML
  - otherwise the index of the given row which caused the error

Definition at line 967 of file ocilib_impl.hpp.

## what()

const char * ocilib::Exception::what | ( |  | ) | const
throw | ( |
| ) |  |

inlineoverride

Override the std::exception::what() method.

Returns
  - The same content as GetMessage() but as using const char * type

Definition at line 920 of file ocilib_impl.hpp.