Exceptn(3)

Exception

Inherits from: Object

Maturity Index: Experimental

Class Description

Exception instances (or instances of a subclass of Exception ) are used to signal exceptions.

To raise an exception, use:
    [[Exception new] signal];

To install a handler to catch an exception, use the Block message:
    [{ ... } on:Exception do: { :anException | ... }];

The argument of the exception handler (the do: Block) is the instance of the Exception class that received the signal message.

Method types

Default Action

Creation
    * signal
    * signal:
    * free

Signalling
    * signal
    * signal:
    * messageText
    * str
    * messageText:
    * str:

Re-Signalling
    * resignalAs:
    * resume

Methods

signal
    + signal

This is a shortcut for:
    [[self new] signal]

signal:
    + signal :(STR) message

This is a shortcut for:
    [[self new] signal:message]

free
    - free

Overridden to dispose attributes.

signal
    - signal

The message evaluates the handler that is installed to deal with this class of exceptions.

Note: If no handler is set, this message currently sends a halt: message with the messageText as argument.

signal:
    - signal :(STR) message

Like signal , but first sets the message text to message .

messageText
    - messageText

This method returns the descriptive text that was associated to the exception instance.

str
    - ( STR ) str

Equivalent to :
    [messageText str]

messageText:
    - messageText : message

Associates a String attribute to the exception.

str:
    - str :(STR) message

Equivalent to messageText: .

resignalAs:
    - resignalAs : replacementException

Signal an alternative exception in place of the receiver.

resume
    - resume

Reinstall the handler that was active at the time the exception was signalled.