Exceptions are instances of the class ExceptionalEvent and are created by sending the message newChild to an existing, or "parent," exception. The most general exception is an instance of ExceptionalEvent called ExAll, which has no parent. All other exceptions are "children" of exactly one other (more general) exception. This creates a hierarchy of exceptions. Instances of ExceptionalEvent maintain the following state:
The following examples create a couple of types of exception:
| anEndOfFileException |
(anEndOfFileException := ExAll newChild)
description: 'end of file'.
| aMessageNotUnderstoodException |
(aMessageNotUnderstoodException := ExAll newChild)
description: 'message not understood'.