Error handling functions
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 functions 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,
const char *errmsg,
void *userdata,
);
Locking Requirements
None
Return values
sOKAY Normal, successful return.
See also
rdm_tfsAllocDatabase
rdm_dbOpen
rdm_dbSetOptions
Parameters
[in] db A valid RDM database handle
[in] errorFunction The custom function that will be called when RDM detects an error condition
[in] userData An option pointer to a buffer that will be passed into the error handler when it is called
struct RDM_DB_S * RDM_DB
Definition: rdmtypes.h:305
RDM_RETCODE
RDM status and error return codes.
Definition: rdmretcodetypes.h:44