Skip to content

Error Handler Functions

To use the functions defined in this section, you should include the header file <X11/Xmu/Error.h> and link against the libXmu or libXmuu library.

int XmuPrintDefaultErrorMessage(Display *dpy, XErrorEvent *event, FILE *fp);
int XmuPrintDefaultErrorMessage(Display *dpy, XErrorEvent *event, FILE *fp);

dpy

specifies the connection to the X server

event

specifies the error

fp

specifies where to print the error message

This function prints an error message, equivalent to Xlib's default error message for protocol errors. It returns a non-zero value if the caller should consider exiting, otherwise it returns 0. This function can be used when you need to write your own error handler, but need to print out an error from within that handler.

int XmuSimpleErrorHandler(Display *dpy, XErrorEvent *errorp);
int XmuSimpleErrorHandler(Display *dpy, XErrorEvent *errorp);

dpy

specifies the connection to the X server

errorp

specifies the error

This function ignores errors for BadWindow errors for XQueryTree and XGetWindowAttributes, and ignores BadDrawable errors for XGetGeometry; it returns 0 in those cases. Otherwise, it prints the default error message, and returns a non-zero value if the caller should consider exiting, and 0 if the caller should not exit.