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 RaimaDB DB Engine Library. Linker option:
-l
rdmrdm
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 RaimaDB 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 RaimaDB 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.
- Locking Requirements
- None
- Return values
-
sOKAY Normal, successful return.
- Parameters
-
[in] db A valid RaimaDB database handle [in] errorFunction The custom function that will be called when RaimaDB detects an error condition [in] userData An option pointer to a buffer that will be passed into the error handler when it is called