Next: Splicing
Prev: Passing Messages
C-- provides two kinds of expressions for handling errors in
expressions. These are the critical expression and the
propagation expression.The critical expression allows you to ignore errors which occur inside an expression. It has the following syntax:
(| expression |)If an error occurs in expression, then the interpreter will stop evaluating expression, and continue to execute the current method as if it had succeeded evaluating expression. The value of expression will be the error code for the error condition which occurred.
The propagation expression allows you to indicate that any errors which occur inside an expression are the responsibility of the calling routine. It has the following syntax:
(> expression <)If an unhandled error occurs in expression, then it will propagate to the calling routine as itself, instead of as
~methoderr.
Critical expressions override the behavior of catch statements, so that errors which occur within critical expressions do not trigger catch error handlers. Propagation expressions do not override critical expressions or catch statements, however; they do not prevent errors from being caught, but only determine how errors propagate if they are not caught.
For more information on how C-- handles errors, see Errors.