Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtAppSetErrorMsgHandler(1)

XtAppSetWarningHandler(1)

XtErrorHandler(2)

Name

XtSetErrorHandler — register a procedure to be called on fatal error conditions. 

Synopsis

void XtSetErrorHandler(handler)

    XtErrorHandler handler;

Arguments

handlerSpecifies the new low-level fatal error procedure, which should not return. 

Description

XtSetErrorHandler has been superseded by XtAppSetErrorHandler.  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 low-level fatal error handler provided by the Intrinsics is _XtError.  On POSIX-based systems, it prints the message to standard error and terminates the application.  Using XtAppSetErrorHandler, you can replace this default error handler with one of your own. 

Fatal error message handlers should not return.  If one does, subsequent Toolkit behavior is undefined. 

See Also

XtAppSetErrorMsgHandler(1), XtAppSetWarningHandler(1),
XtErrorHandler(2). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026