Back: Error-exception description Up: Base classes Forward: Exception class-comparison   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.69 Exception

Defined in namespace Smalltalk
Superclass: Signal
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.

1.69.1 Exception class: comparison  (class)
1.69.2 Exception class: creating ExceptionCollections  (class)
1.69.3 Exception class: initialization  (class)
1.69.4 Exception class: instance creation  (class)
1.69.5 Exception class: interoperability with TrappableEvents  (class)
1.69.6 Exception: comparison  (instance)
1.69.7 Exception: exception description  (instance)
1.69.8 Exception: exception signaling  (instance)


1.69.1 Exception class: comparison

goodness: anException
Answer how good the receiver is at handling the given exception. A negative value indicates that the receiver is not able to handle the exception.

handles: anException
Answer whether the receiver handles `anException'.


1.69.2 Exception class: creating ExceptionCollections

, aTrappableEvent
Answer an ExceptionCollection containing all the exceptions in the receiver and all the exceptions in aTrappableEvent


1.69.3 Exception class: initialization

initialize
Initialize the `links' between the core exception handling system and the ANSI exception handling system.


1.69.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.


1.69.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


1.69.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.


1.69.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.


1.69.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.



Back: Exception-exception description Up: Exception Forward: ExceptionSet   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on July, 23 2009 using texi2html