Products Support Documentation Download
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 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,
const RDM_TCHAR_T *errmsg,
void *userdata,
RDM_DB db
);
Locking Requirements
None
Return values
sOKAYNormal, successful return.
See also
rdm_tfsAllocDatabase
rdm_dbOpen
rdm_dbSetOptions
Parameters
[in]dbA valid RDM database handle
[in]errorFunctionThe custom function that will be called when RDM detects an error condition
[in]userDataAn option pointer to a buffer that will be passed into the error handler when it is called