Occasionally, it is desirable to use a single handler for several nonhierarchically related exceptions. To handle this situation, the when:do: syntax has been extended to allow an ExceptionalEvent collection as the when argument. ExceptionalEvent collections are created by sending the vertical bar (|) message to an instance of ExceptionalEvent as follows:In class ExceptionalEvent:In the ExceptionalEvent collection:ExceptionalEvent collections can be stored in a variable and later referred to:ExceptionalEvent collections cannot be signaled.Within the body of a handler block, sending exception to the passed-in instance of Signal always answers the particular exception that was signaled.
|