SERIALBOX_API typedef void(* | serialboxFatalErrorHandler_t )(const char *reason) |
Error handler callback. | |
SERIALBOX_API void | serialboxFatalError (const char *reason) |
Report a fatal error. More... | |
SERIALBOX_API void | serialboxInstallFatalErrorHandler (serialboxFatalErrorHandler_t handler) |
Install a fatal error handler. More... | |
SERIALBOX_API void | serialboxResetFatalErrorHandler (void) |
Reset the fatal error handler. More... | |
void | serialboxDefaultFatalErrorHandler (const char *reason) |
Emit the last error string to stderr and call exit(1) | |
SERIALBOX_API void | serialboxStateErrorHandler (const char *reason) |
Store the the current state of the error which can be queried via serialboxStateErrorHandlerGetLastError. | |
SERIALBOX_API int | serialboxStateErrorHandlerHasError (void) |
Check the current error state. More... | |
SERIALBOX_API char * | serialboxStateErrorHandlerGetErrorMessage (void) |
Query the current error state. More... | |
SERIALBOX_API void | serialboxStateErrorHandlerResetState (void) |
Reset the current error state. | |
SERIALBOX_API void serialboxFatalError | ( | const char * | reason | ) |
Report a fatal error.
This will function will invoke the installed FatalErrorHandler.
Definition at line 36 of file ErrorHandling.cpp.
SERIALBOX_API void serialboxInstallFatalErrorHandler | ( | serialboxFatalErrorHandler_t | handler | ) |
Install a fatal error handler.
By default, if Serialbox detects a fatal error it will emit the last error string to stderr and call exit(1).
This may not be appropriate in some contexts. For example, the Python module might want to translate the errror into an exception. This function allows you to install a callback that will be invoked after a fatal error occurred.
Definition at line 27 of file ErrorHandling.cpp.
SERIALBOX_API void serialboxResetFatalErrorHandler | ( | void | ) |
Reset the fatal error handler.
This resets Serialbox's fatal error handling behavior to the default.
Definition at line 32 of file ErrorHandling.cpp.
SERIALBOX_API char* serialboxStateErrorHandlerGetErrorMessage | ( | void | ) |
Query the current error state.
This function requires to set the ErrorHandler to serialboxStateErrorHandler.
char*
with the current error message Definition at line 69 of file ErrorHandling.cpp.
SERIALBOX_API int serialboxStateErrorHandlerHasError | ( | void | ) |
Check the current error state.
This function requires to set the ErrorHandler to serialboxStateErrorHandler. To obtain the associated error message, use serialboxStateErrorHandlerGetErrorMessage.
Definition at line 67 of file ErrorHandling.cpp.