Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtAppSetErrorHandler(1)

XtAppSetWarningMsgHandler(1)

XtErrorMsgHandler(2)

Name

XtSetErrorMsgHandler — register a procedure to be called on nonfatal error conditions. 

Synopsis

void XtSetErrorMsgHandler(msg_handler)

    XtErrorMsgHandler msg_handler;

Arguments

msg_handler
Specifies the new high-level fatal error procedure, which should not return.

Description

XtSetErrorMsg has been superseded by XtAppSetErrorMsgHandler.  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, XtAppSetErrorHandler, or XtAppSetWarningHandler. 

•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 error handler provided by the Intrinsics constructs a string from the error resource database and calls XtAppError.  Using XtAppSetErrorMsgHandler, you can replace this with your own handler. 

See Also

XtAppSetErrorHandler(1), XtAppSetWarningMsgHandler(1),
XtErrorMsgHandler(2). 

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