OCILIB (C and C++ Driver for Oracle)  4.7.6
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
ocilib::Exception Class Reference

Exception class handling all OCILIB errors. More...

#include <types.hpp>

Inheritance diagram for ocilib::Exception:

Public Types

enum  ExceptionTypeValues { OracleError = OCI_ERR_ORACLE , OcilibError = OCI_ERR_OCILIB , OracleWarning = OCI_ERR_WARNING }
 Exception type enumerated values. More...
 
typedef core::Enum< ExceptionTypeValuesExceptionType
 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 noexcept override
 Override the std::exception::what() method. More...
 
virtual ~Exception () noexcept
 Virtual destructor required for deriving from std::exception.
 

Detailed Description

Exception class handling all OCILIB errors.

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

Definition at line 357 of file types.hpp.

Member Typedef Documentation

◆ ExceptionType

Member Enumeration Documentation

◆ 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 370 of file types.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 225 of file Exception.hpp.

◆ what()

const char * ocilib::Exception::what ( ) const
inlineoverridenoexcept

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

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

Definition at line 149 of file Exception.hpp.

Referenced by GetMessage().