ViewerErrors.mesa
Copyright Ó 1991 by Xerox Corporation. All rights reserved.
Christian Jacobi, September 5, 1991 12:04 pm PDT
This interface lets clients register a set of errors which need special treatment. In particular, Viewer Paint procedures will raise errors if the display device disappears; such errors can be ambushed before the debugger is called.
This is a low level, private interface.
ViewerErrors: CEDAR DEFINITIONS ~ BEGIN
SIGANY: TYPE ~ SIGNAL ANY RETURNS ANY;
It is safe to loophole errors into SIGANY
PreCatchProc: TYPE = PROC [signalOrError: SIGANY] RETURNS [continue: BOOL ¬ TRUE];
A PreCatchProc gives the client a chance to visit an error before the debugger is called. If the PreCatchProc returns true the caller will continue, otherwise the caller will reject the error.
A PreCatchProc should not raise any further errors. It is typically called from a Viewer-Paint procedure and has no process properties.
Register: PROC [signalOrError: SIGANY, handle: PreCatchProc];
Registers an PreCatchProc for a particular error.
Once an error is registered, it can not be undone.
Query: PRIVATE PROC [signalOrError: SIGANY] RETURNS [continue: BOOL];
Viewer-implementations way to query the registered PreCatchProc whether to CONTINUE
END.