Signaling an exception
Exceptions are signaled by sending one of the following methods to the appropriate instance of ExceptionalEvent:
Invokes the exception with no arguments.
Invokes the exception with a single argument.
Invokes the exception with two arguments.
Invokes the exception with anArray of arguments
The following examples signal a couple of types of exception:
Example: signaling end of file
| anEndOfFileException |
(anEndOfFileException := ExAll newChild)
description: 'end of file'.
anEndOfFileException signal.
Example: signaling message not understood
| aMessageNotUnderstoodException |
(aMessageNotUnderstoodException := ExAll newChild)
description: 'message not understood'.
signalWith: (DirectedMessage selector: #halt arguments: #() receiver: self)
When an exception is signaled, an instance of class Signal is created that contains information describing the circumstances where the exception occurred.
Last modified date: 01/29/2015