Squeak Class Documentation category index | class index  
 
Exception
  category: System-Exceptions Kernel
  superclass: Object
  subclasses: Error IllegalResumeAttempt Notification ProgressInitiationException TestFailure

This is the main class used to implement the exception handling system (EHS). It plays two distinct roles: that of the exception, and that of the exception handler. More specifically, it implements the bulk of the protocols laid out in the ANSI specification - those protocol names are reflected in the message categories.

Exception is an abstract class. Instances should neither be created nor trapped. In most cases, subclasses should inherit from Error or Notification rather than directly from Exception.

In implementing this EHS, The Fourth Estate Inc. incorporated some ideas and code from Craig Latta's EHS. His insights were crucial in allowing us to implement BlockContext>>valueUninterruptably (and by extension, #ensure: and #ifCurtailed:), and we imported the following methods with little or no modification:

ContextPart>>terminateTo:
ContextPart>>terminate
MethodContext>>receiver:
MethodContext>>answer:

Thanks, Craig!

instance methods
  Camp Smalltalk
  sunitExitWith:

  exceptionBuilder
  messageText:
tag:

  exceptionDescription
  defaultAction
description
isResumable
messageText
tag

  exceptionSignaler
  signal
signal:

  private
  findHandlerFrom:
handlerAction
initialContext:
receiver
setHandlerFrom:

  signaledException
  isNested
outer
pass
resignalAs:
resume
resume:
retry
retryUsing:
return
return:

class methods
  Camp Smalltalk
  sunitSignalWith:

  exceptionInstantiator
  signal
signal:

  exceptionSelector
  ,
handles:

instance methods
  Camp Smalltalk top  
 

sunitExitWith:


  exceptionBuilder top  
 

messageText:

Set an exception's message text.


 

tag:

This message is not specified in the ANSI protocol, but that looks like an oversight because #tag is specified, and the spec states that the signaler may store the tag value.


  exceptionDescription top  
 

defaultAction

The default action taken if the exception is signaled.


 

description

Return a textual description of the exception.


 

isResumable

Determine whether an exception is resumable.


 

messageText

Return an exception's message text.


 

tag

Return an exception's tag value.


  exceptionSignaler top  
 

signal

Signal the occurrence of an exceptional condition.


 

signal:

Signal the occurrence of an exceptional condition with a specified textual description.


  private top  
 

findHandlerFrom:


 

handlerAction


 

initialContext:


 

receiver


 

setHandlerFrom:


  signaledException top  
 

isNested

Determine whether the current exception handler is within the scope of another handler for the same exception.


 

outer

Evaluate the enclosing exception action for the receiver and return.


 

pass

Yield control to the enclosing exception action for the receiver.


 

resignalAs:

Signal an alternative exception in place of the receiver.


 

resume

Return from the message that signaled the receiver.


 

resume:

Return the argument as the value of the message that signaled the receiver.


 

retry

Abort an exception handler and re-evaluate its protected block.


 

retryUsing:

Abort an exception handler and evaluate a new block in place of the handler's protected block.


 

return

Return nil as the value of the block protected by the active exception handler.


 

return:

Return the argument as the value of the block protected by the active exception handler.


class methods
  Camp Smalltalk top  
 

sunitSignalWith:


  exceptionInstantiator top  
 

signal

Signal the occurrence of an exceptional condition.


 

signal:

Signal the occurrence of an exceptional condition with a specified textual description.


  exceptionSelector top  
 

,

Create an exception set.


 

handles:

Determine whether an exception handler will accept a signaled exception.