Name
XtSetWarningHandler — register a procedure to be called on nonfatal error conditions.
Synopsis
void XtSetWarningHandler(handler)
XtErrorHandler handler;
Arguments
handlerSpecifies the new low-level nonfatal error procedure, which usually returns.
Description
XtSetWarningHandler has been superseded by XtAppSetWarningHandler. The Intrinsics let a client register procedures that are to be called whenever a fatal or nonfatal error occurs. These facilities are intended for both error reporting and logging and for error correction or recovery.
Two levels of interface are provided:
•A high-level interface that takes an error name and class and looks the error up in an error resource database. The high-level fatal error handler is invoked by a call to XtErrorMsg or XtAppErrorMsg; the high-level nonfatal error handler is invoked by a call to XtWarningMsg or XtAppWarningMsg. A new handler can be registered by calling XtSetErrorMsgHandler, XtAppSetErrorMsgHandler, or XtAppSetWarningMsgHandler.
•A low-level interface that takes a simple string, which is printed out as the error message. The low-level fatal error handler is invoked by a call to XtError or XtAppError; the low-level nonfatal error handler is invoked by a call to XtWarning or XtAppWarning. A new handler can be registered by calling XtSetErrorHandler, XtSetWarningHandler, XtAppSetErrorHandler, or XtAppSetWarningHandler.
The high-level functions construct a string to pass to the lower-level interface. On POSIX-based systems, the error database is usually /usr/lib/X11/XtErrorDB.
To obtain the error database (for example, to merge with an application or widget-specific database), use XtAppGetErrorDatabase.
Application-context-specific error handling is not implemented on many systems. Most implementations will have just one set of error handlers. If they are set for different application contexts, the one set last will prevail.
The default warning handler provided by the Intrinsics is _XtWarning. On POSIX-based systems, it prints the message to standard error and returns to the caller. Using XtAppSetWarningHandler, you can replace this handler with one of your own.
Warning message handlers should return. If an error is non-recoverable, an application should generate a fatal error.
See Also
XtSetErrorHandler(1), XtSetWarningMsgHandler(1), XtWarning(1),
XtErrorHandler(2), XtErrorMsgHandler(2).