Error handling API for a database. All the fuctions here are located in RDM DB Engine Library. Linker option: More...

Collaboration diagram for Error handling functions:

Functions

RDM_RETCODE rdm_dbSetErrorHandler (RDM_DB db, RDM_ERROR_FCN errorFunction, void *userData)
Replace default error reporting with a custom function. More...

Detailed Description

Error handling API for a database. All the fuctions here are located in RDM DB Engine Library. Linker option:

    -lrdmrdm

Function Documentation

rdm_dbSetErrorHandler()

RDM_RETCODE rdm_dbSetErrorHandler ( RDM_DB db,
RDM_ERROR_FCN errorFunction,
void * userData
)

#include <rdmdbapi.h>

Replace default error reporting with a custom function.

This function accepts a pointer to a function that will be called when RDM detects an error. The provided function supersedes the internal errorFunction function. The error reporting function must be a void function with the correct prototype, as shown below.

In the function prototype

  • The RDM_RETCODE is the error code as defined in RDM header files
  • The character pointer points to the error message
  • The RDM_DB pointer will be the db where the error occurred
  • The void pointer is the same pointer which was passed to rdm_dbSetErrorHandler() function, allowing the error reporting function to retrieve more information if it is called.
void MyErr (
RDM_RETCODE errnum,
constRDM_TCHAR_T *errmsg,
void *userdata,
RDM_DB db
);
Locking Requirements
None
Return values
sOKAY Normal, successful return.
See also
rdm_tfsAllocDatabase
rdm_dbOpen
rdm_dbSetOptions
Parameters
[in] db [in] A valid RDM database handle
[in] errorFunction [in] The custom function that will be called when RDM detects an error condition
[in] userData [in] An option pointer to a buffer that will be passed into the error handler when it is called
#define RDM_TCHAR_T
Definition: psptypes.h:128
struct RDM_DB_S * RDM_DB
Definition: rdmtypes.h:241
RDM_RETCODE
RDM status and error return codes.
Definition: rdmretcodetypes.h:42