This group contains methods for custom error handling.
More...
This group contains methods for custom error handling.
|
| static void | CatchGlobalErrors (bool catch_all, bool exit) |
| | Installs the GLG error handler as a global error handler for processing any uncaught exceptions in a GLG application. More...
|
| |
| static void | Error (GlgErrorType error_type, String message, Exception exception, bool async_error=false) |
| | Display an error message using the GLG error handler. More...
|
| |
| static GlgErrorHandler | SetErrorHandler (GlgErrorHandler new_handler) |
| | Replaces the GLG Toolkit error handler and returns the previous error handler. More...
|
| |
◆ CatchGlobalErrors()
| static void CatchGlobalErrors |
( |
bool |
catch_all, |
|
|
bool |
exit |
|
) |
| |
|
static |
Installs the GLG error handler as a global error handler for processing any uncaught exceptions in a GLG application.
This method may be invoked on application start-up to log exceptions and display a stack trace for application errors via the GLG error handler.
- Parameters
-
| catch_all | If true, all exceptions will be caught, otherwise only thread exceptions will be caught. |
| exit | If true, the application will exit after displaying an error message. |
◆ Error()
| static void Error |
( |
GlgErrorType |
error_type, |
|
|
String |
message, |
|
|
Exception |
exception, |
|
|
bool |
async_error = false |
|
) |
| |
|
static |
Display an error message using the GLG error handler.
Invokes a currently installed error handler to generate an error message. See GlgErrorType for details on how different message types are handled by the default error handler.
- Parameters
-
| error_type | Specifies an error type, may be one of the following:
|
| message | The message to be displayed. |
| exception | An optional exception that caused the error. If it is not null, it is used to extract additional information and an exact stack trace. |
| async_error | (optional, can be omitted). By default, errors are reported using a modal dialog which can disrupt window event sequence. If this parameter is present and set to true, the error dialog is activated on the event thread using a timer to prevent problems when errors are reported while processing Windows events. |
◆ SetErrorHandler()
Replaces the GLG Toolkit error handler and returns the previous error handler.
- Parameters
-
| new_handler | Specifies a new error handler, supplied by the user, to be called on an error condition. This does not include internal errors of the GLG Toolkit, if any are detected: they are still reported using the default handler. |
- Returns
- The previous error handler.
The GLG default error handler emits an audio beep and logs the error in the glg_error.log file.
See GlgErrorType for details on how different message types are handled by the default error handler.