|
|
6.63 Exception
- Defined in namespace Smalltalk
- Category: Language-Exceptions
- An Exception defines the characteristics of an exceptional event
in a different way than CoreExceptions. Instead of creating an
hierarchy of objects and setting attributes of the objects, you
create an hierarchy of classes and override methods in those classes;
instances of those classes are passed to the handlers instead of
instances of the common class Signal.
Internally, Exception and every subclass of it hold onto a
CoreException, so the two mechanisms are actually interchangeable.
6.63.1 Exception class: comparison
- handles: anException
- Answer whether the receiver handles `anException'.
6.63.2 Exception class: creating ExceptionCollections
- , aTrappableEvent
- Answer an ExceptionCollection containing all the exceptions in the receiver and all the exceptions in aTrappableEvent
6.63.3 Exception class: initialization
- initialize
- Initialize the `links' between the core exception handling system and the ANSI exception handling system.
6.63.4 Exception class: instance creation
- new
- Create an instance of the receiver, which you will be able to signal later.
- signal
- Create an instance of the receiver, give it default attributes, and signal it immediately.
- signal: messageText
- Create an instance of the receiver, set its message text, and signal it immediately.
6.63.5 Exception class: interoperability with TrappableEvents
- allExceptionsDo: aBlock
- Private - Pass the coreException to aBlock
- coreException
- Private - Answer the coreException which represents instances of the receiver
- whenSignalledIn: onDoBlock do: handlerBlock exitBlock: exitBlock
- Private - Create an ExceptionHandler from the arguments and register it
6.63.6 Exception: comparison
- = anObject
- Answer whether the receiver is equal to anObject. This is true if either the receiver or its coreException are the same object as anObject.
- hash
- Answer an hash value for the receiver.
6.63.7 Exception: exception description
- defaultAction
- Execute the default action that is attached to the receiver.
- description
- Answer a textual description of the exception.
- isResumable
- Answer true. Exceptions are by default resumable.
6.63.8 Exception: exception signaling
- signal
- Raise the exceptional event represented by the receiver
- signal: messageText
- Raise the exceptional event represented by the receiver, setting its message text to messageText.
|