sdaiSetErrorHandler


Defines the current _EDMinterface_ error handler function. An _EDMinterface_ error handler is a function that will be invoked each time the EDMinterface detects an error during operation. Only one _EDMinterface_ error handler can be defined at the same time, hence the current _EDMinterface_ error handler is the result of the latest performed sdaiSetErrorHandler operation.
No _EDMinterface_ error handler exists for the calling application before the first invocation of this operation. An _EDMinterface_ error handler is local to the calling application.
The signature of a SdaiErrorHandler function is:
 void errorHandler(SdaiErrorCode errCode);
Related function: sdaiGetErrorHandler
Header:
#include "sdai.h"
Prototype:
void sdaiSetErrorHandler(SdaiErrorHandler function);
Arguments:

function

The function to be defined as the _EDMinterface_ error handler for the calling program.

Returns:
Void – use sdaiErrorQuery to check for error in operation.
Example:
SdaiErrorHandler errHandler;
...
errHandler = sdaiGetErrorHandler(); /* save current error handler */
sdaiSetErrorHandler("mySdaiErorHandler"); /* set new error handler */
. . .
sdaiSetErrorHandler(newErrHandler); /* reset to original error handler */
. . .