C Driver API 3.0.0
API for the NuoDB C Driver Library
Loading...
Searching...
No Matches
NuoDB_Error Struct Reference

NuoDB error information data structure More...

#include <error.h>

Data Fields

_NuoDB_Error_state_t * _state
 
NuoDB_Connection *(* getConnection )(NuoDB_Error *_this)
 Returns the NuoDB_Connection for the specified error data structure.
 
const char *(* getSqlState )(NuoDB_Error *_this)
 Returns the SQL State string.
 
NuoDB_Statement *(* getStatement )(NuoDB_Error *_this)
 Returns the NuoDB_Statement for the specified error data structure, if known.
 
NuoDB_Status(* getStatus )(NuoDB_Error *_this)
 Returns the error status, which is a enumerated integer code for errors that can be returned by this driver.
 
const char *(* getText )(NuoDB_Error *_this)
 Returns text of the error message.
 
const char *(* getTrace )(NuoDB_Error *_this)
 Returns stack trace for the error.
 

Detailed Description

NuoDB error information data structure

The NuoDB_Error data structure contains information about a error condition.

There are three mechanisms for error handling:

  • Global error handling through callback functions provided by the client, registered with the function NuoDB_Error_registerCallback().
  • Local error handling by checking integer return codes from functions. Functions that return a error code will be integer zero (0) to indicate success, or a negative integer to indicate an error condition.
  • Contextual thread error checking by calling the function NuoDB_Error_getLastErrorInfo() to retrieve the last known error.

Field Documentation

◆ getConnection

NuoDB_Connection *(* NuoDB_Error::getConnection) (NuoDB_Error *_this)

Returns the NuoDB_Connection for the specified error data structure.

Parameters
[in]_thisa pointer to the current (this) data structure.
Returns
pointer to NuoDB_Connection.

◆ getSqlState

const char *(* NuoDB_Error::getSqlState) (NuoDB_Error *_this)

Returns the SQL State string.

Parameters
[in]_thisa pointer to the current (this) data structure.
Returns
a pointer to a string that contains the SQL State code.

◆ getStatement

NuoDB_Statement *(* NuoDB_Error::getStatement) (NuoDB_Error *_this)

Returns the NuoDB_Statement for the specified error data structure, if known.

Parameters
[in]_thisa pointer to the current (this) data structure.
Returns
pointer to the NuoDB_Statement data structure that was involved with the error. If the NuoDB_Statement was unknown at the time of the error, this function will return NULL.

◆ getStatus

NuoDB_Status(* NuoDB_Error::getStatus) (NuoDB_Error *_this)

Returns the error status, which is a enumerated integer code for errors that can be returned by this driver.

Parameters
[in]_thisa pointer to the current (this) data structure.
Returns
NuoDB_Status enumerated type

◆ getText

const char *(* NuoDB_Error::getText) (NuoDB_Error *_this)

Returns text of the error message.

Parameters
[in]_thisa pointer to the current (this) data structure.
Returns
a pointer to a string that contains the error message.

◆ getTrace

const char *(* NuoDB_Error::getTrace) (NuoDB_Error *_this)

Returns stack trace for the error.

If the stack trace is known at the point of the error condition, then the return value will contain a pointer to a string that represents the entire stack trace.

Parameters
[in]_thisa pointer to the current (this) data structure.
Returns
pointer to a string that contains the stack trace, or NULL if the stack trace is unknown at the time of the error.

The documentation for this struct was generated from the following file: