[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


5.2.11 Reporting an Exception

DECthreads reports an exception only when it is raised without a CATCH or CATCH_ALL, immediately before the process is terminated. Sometimes client code might wish to report an exception as part of error recovery. The pthread_exc_report_np() function prints a message to stderr or SYS$ERROR describing the exception.

All predefined exceptions have an associated message describing the error. Normally, when the DECthreads exception package has been well-integrated with a platform status mechanism, external status values can also be reported. However, when an address exception is reported, DECthreads can only report the fact that an exception has occurred, and the address of the exception object.

Following is an example of reporting an error:

void pthread_exc_report_np (EXCEPTION *exception);

For example:

pthread_exc_report_np (&illinstr);