Exceptions

Abort
An Abort is xxxxxxxxx.
Instance Variables
defaultAction
No one has handled this error, but now give them a chance to decide how to debug it. If none handle this either then open debugger (see UnhandedError-defaultAction)
ArithmeticError
An ArithmeticError is xxxxxxxxx.
Instance Variables
AssertionFailure
AsssertionFailure is the exception signaled from Object>>assert: when the assertion block evaluates to false.
BlockCannotReturn
This class is private to the EHS implementation. Its use allows for ensured execution to survive code such as:
[self doThis.
^nil]
ensure: [self doThat]
Signaling or handling this exception is not recommended.
deadHome
deadHome:
defaultAction
No one has handled this error, but now give them a chance to decide how to debug it. If none handle this either then open debugger (see UnhandedError-defaultAction)
isResumable
Determine whether an exception is resumable.
result
result:
CannotDeleteFileException
A CannotDeleteFileException is xxxxxxxxx.
Instance Variables
Deprecation
This Warning is signalled by methods which are deprecated.
The use of Object>>#deprecatedExplanation: aString and Object>>#deprecated: aBlock explanation: aString is recommended.
Idiom: Imagine I want to deprecate the message #foo.
foo
^ 'foo'
I can replace it with:
foo
self deprecatedExplanation: 'The method #foo was not good. Use Bar>>newFoo instead.'
^ 'foo'
Or, for certain cases such as when #foo implements a primitive, #foo can be renamed to #fooDeprecated.
fooDeprecated
^ <primitive>
foo
^ self deprecated: [self fooDeprecated] explanation: 'The method #foo was not good. Use Bar>>newFoo instead.'
=
Answer whether the receiver and the argument represent the same
object. If = is redefined in any subclass, consider also redefining the
message hash.
defaultAction
The user should be notified of the occurrence of an exceptional occurrence and given an option of continuing or aborting the computation. The description of the occurrence should include any text specified as the argument of the #signal: message.
deprecationDate
Answer the value of deprecationDate
deprecationsWhile:
explanationString
Answer the value of explanationString
hash
Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define =
initialize
Subclasses should redefine this method to perform initializations on instance creation
messageText
Return an exception's message text.
method:explanation:on:in:
methodReference
Answer the value of methodReference
versionString
Answer the value of versionString
EndOfStream
Signalled when ReadStream>>next encounters a premature end.
defaultAction
Answer ReadStream>>next default reply.
isResumable
EndOfStream is resumable, so ReadStream>>next can answer.
Error
>From the ANSI standard:
This protocol describes the behavior of instances of class Error. These are used to represent error conditions that prevent the normal continuation of processing. Actual error exceptions used by an application may be subclasses of this class.
As Error is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.
Additional notes:
Error>defaultAction uses an explicit test for the presence of the Debugger class to decide whether or not it is in development mode. In the future, TFEI hopes to enhance the semantics of #defaultAction to improve support for pluggable default handlers.
defaultAction
No one has handled this error, but now give them a chance to decide how to debug it. If none handle this either then open debugger (see UnhandedError-defaultAction)
isResumable
Determine whether an exception is resumable.
Exception
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!
,
browserIcon
defaultAction
The default action taken if the exception is signaled.
description
Return a textual description of the exception.
handles:
This method exists in case a non exception class is the first arg in an on:do: (for instance using a exception class that is not loaded). We prefer this to raising an error during error handling itself. Also, semantically it makes sense that the exception handler is not active if its exception class is not loaded
isNested
Determine whether the current exception handler is within the scope of another handler for the same exception.
isResumable
Determine whether an exception is resumable.
messageText
Return an exception's message text.
messageText:
Set an exception's message text.
outer
Evaluate the enclosing exception action and return to here instead of signal if it resumes (see #resumeUnchecked:).
pass
Yield control to the enclosing exception action for the receiver.
possibleCauses
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
privHandlerContext:
raiseSignal
raiseSignal:
receiver
resignalAs:
Signal an alternative exception in place of the receiver.
resume
Return from the message that signaled the receiver.
resume:
Return resumptionValue as the value of the signal message.
resumeUnchecked:
Return resumptionValue as the value of #signal, unless this was called after an #outer message, then return resumptionValue as the value of #outer.
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.
searchFrom:
Set the context where the handler search will start.
signal
Ask ContextHandlers in the sender chain to handle this signal. The default is to execute and return my defaultAction.
signal:
Signal the occurrence of an exceptional condition with a specified textual description.
signalerContext
Find the first sender of signal(:)
tag
Return an exception's tag value.
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.
ExceptionAboutToReturn
This class is private to the EHS implementation. Its use allows for ensured execution to survive code such as:
[self doThis.
^nil]
ensure: [self doThat]
Signaling or handling this exception is not recommended. Not even slightly.
ExceptionSet
An ExceptionSet is a grouping of exception handlers which acts as a single handler. Within the group, the most recently added handler will be the last handler found during a handler search (in the case where more than one handler in the group is capable of handling a given exception).
,
Return an exception set that contains the receiver and the argument exception. This is commonly used to specify a set of exception selectors for an exception handler.
add:
handles:
Determine whether an exception handler will accept a signaled exception.
initialize
Subclasses should redefine this method to perform initializations on instance creation
FTPConnectionException
A FTPConnectionException is xxxxxxxxx.
Instance Variables
defaultAction
No one has handled this error, but now give them a chance to decide how to debug it. If none handle this either then open debugger (see UnhandedError-defaultAction)
isResumable
Determine whether an exception is resumable.
FileDoesNotExistException
A FileDoesNotExistException is xxxxxxxxx.
Instance Variables
readOnly: <Object>
readOnly
- xxxxx
defaultAction
The default action taken if the exception is signaled.
example
readOnly
readOnly:
FileExistsException
A FileExistsException is xxxxxxxxx.
Instance Variables
fileClass: <Object>
fileClass
- xxxxx
defaultAction
The default action taken if the exception is signaled.
fileClass
fileClass:
fileName:fileClass:
FileStreamException
A FileStreamException is xxxxxxxxx.
Instance Variables
fileName: <Object>
fileName
- xxxxx
fileName
fileName:
isResumable
Determine whether an exception is resumable.
messageText
Return an exception's message text.
FloatingPointException
A FloatingPointException is xxxxxxxxx.
Instance Variables
Halt
Halt is provided to support Object>>halt.
defaultAction
No one has handled this error, but now give them a chance to decide how to debug it. If none handle this either then open debugger (see UnhandedError-defaultAction)
IllegalResumeAttempt
This class is private to the EHS implementation. An instance of it is signaled whenever an attempt is made to resume from an exception which answers false to #isResumable.
defaultAction
No one has handled this error, but now give them a chance to decide how to debug it. If none handle this either then open debugger (see UnhandedError-defaultAction)
isResumable
Determine whether an exception is resumable.
readMe
Never handle this exception!
InMidstOfFileinNotification
An InMidstOfFileinNotification is xxxxxxxxx.
Instance Variables
defaultAction
No action is taken. The value nil is returned as the value of the message that signaled the exception.
InvalidDirectoryError
An InvalidDirectoryError is xxxxxxxxx.
Instance Variables
pathName: <Object>
pathName
- xxxxx
defaultAction
No one has handled this error, but now give them a chance to decide how to debug it. If none handle this either then open debugger (see UnhandedError-defaultAction)
pathName
pathName:
MessageNotUnderstood
This exception is provided to support Object>>doesNotUnderstand:.
defaultAction
No one has handled this error, but now give them a chance to decide how to debug it. If none handle this either then open debugger (see UnhandedError-defaultAction)
initialize
Subclasses should redefine this method to perform initializations on instance creation
isResumable
Determine whether an exception is resumable.
message
Answer the selector and arguments of the message that failed.
message:
messageText
Return an exception's message text.
possibleCauses
reachedDefaultHandler
receiver
Answer the receiver that did not understand the message
receiver:
NonBooleanReceiver
A NonBooleanReceiver is xxxxxxxxx.
Instance Variables
object: <Object>
object
- xxxxx
isResumable
Determine whether an exception is resumable.
object
object:
Notification
A Notification is an indication that something interesting has occurred. If it is not handled, it will pass by without effect.
defaultAction
No action is taken. The value nil is returned as the value of the message that signaled the exception.
OutOfScopeNotification
An OutOfScopeNotification is xxxxxxxxx.
Instance Variables
defaultAction
No action is taken. The value nil is returned as the value of the message that signaled the exception.
PickAFileToWriteNotification
A PickAFileToWriteNotification is xxxxxxxxx.
Instance Variables
ProgressInitiationException
I provide a way to alter the behavior of the old-style progress notifier in String. See examples in:
ProgressInitiationException testWithout.
ProgressInitiationException testWith.
defaultAction
The default action taken if the exception is signaled.
defaultMorphicAction
display:at:from:to:during:
sendNotificationsTo:
testInnermost
testWith
testWithAdditionalInfo
testWithout
ProgressNotification
Used to signal progress without requiring a specific receiver to notify. Caller/callee convention could be to simply count the number of signals caught or to pass more substantive information with #signal:.
amount
amount:
done
done:
extraParam
extraParam:
signal:extra:
ProgressTargetRequestNotification
I am used to allow the ComplexProgressIndicator one last chance at finding an appropriate place to display. If I am unhandled, then the cursor location and a default rectangle are used.
defaultAction
No action is taken. The value nil is returned as the value of the message that signaled the exception.
ProjectEntryNotification
I provide a way to override the style of Project entry (which is buried deep in several different methods). My default is a normal full-screen enter.
defaultAction
No action is taken. The value nil is returned as the value of the message that signaled the exception.
projectToEnter
projectToEnter:
signal:
Signal the occurrence of an exceptional condition with a specified textual description.
ProjectViewOpenNotification
ProjectViewOpenNotification is signalled to determine if a ProjectViewMorph is needed for a newly created project. The default answer is yes.
defaultAction
No action is taken. The value nil is returned as the value of the message that signaled the exception.
ProvideAnswerNotification
A ProvideAnswerNotification is xxxxxxxxx.
Instance Variables
SyntaxErrorNotification
A SyntaxErrorNotification is xxxxxxxxx.
Instance Variables
category: <Object>
code: <Object>
doitFlag: <Object>
errorMessage: <Object>
inClass: <Object>
location: <Object>
category
- xxxxx
code
- xxxxx
doitFlag
- xxxxx
errorMessage
- xxxxx
inClass
- xxxxx
location
- xxxxx
category
defaultAction
No one has handled this error, but now give them a chance to decide how to debug it. If none handle this either then open debugger (see UnhandedError-defaultAction)
doitFlag
errorClass
errorCode
errorMessage
inClass:category:withCode:doitFlag:
inClass:category:withCode:doitFlag:errorMessage:location:
location
messageText
Return an exception's message text.
setClass:category:code:doitFlag:
setClass:category:code:doitFlag:errorMessage:location:
TimedOut
I am signalled by #duration:timeoutDo: if the receiving block takes too long to execute.
I am signalled by a watchdog process spawned by #duration:timeoutDo: and caught in the same method.
I am not intended to be used elsewhere.
UnhandledError
An UnhandledError is xxxxxxxxx.
Instance Variables
exception: <Object>
exception
- xxxxx
defaultAction
The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated.
exception
exception:
isResumable
Determine whether an exception is resumable.
signalForException:
Warning
A Warning is a Notification which by default should be brought to the attention of the user.
defaultAction
The user should be notified of the occurrence of an exceptional occurrence and given an option of continuing or aborting the computation. The description of the occurrence should include any text specified as the argument of the #signal: message.
ZeroDivide
ZeroDivide may be signaled when a mathematical division by 0 is attempted.
dividend
Answer the number that was being divided by zero.
dividend:
Specify the number that was being divided by zero.
isResumable
Determine whether an exception is resumable.
signalWithDividend: