Register a fatal error handler.
void mco_error_set_handler( /*IN*/ mco_error_handler_f func);
func
This function registers an application function to handle fatal error conditions. It is called from the runtime's function
mco_stop(), which is called whenever an unrecoverable error is encountered (with return codes MCO_ERR_*). Accordingly, your error handling function will accept a single int argument, which is the eXtremeDB error code (MCO_ERR_*) value that caused the error handler to be invoked. If an error handler is not registered,mco_stop()will enter an infinite loop.
void
Application snippet:
const char * dbname = "SimpleDb";
static void errhandler( MCO_RET errcode)
{
printf( "\n eXtremeDB runtime fatal error: %d\n", errcode );
getchar();
exit( -1 );
}
int main(int argc, char* argv[])
{
mco_db_h db;
MCO_RET rc;
mco_device_t dev;
mco_db_params_t db_params;
...
mco_error_set_handler( &errhandler );
if( (rc = mco_runtime_start()) != MCO_S_OK)
exit(-1);
}