--- a/Exception.st Sun Jan 16 04:38:33 1994 +0100
+++ b/Exception.st Sun Jan 16 04:47:41 1994 +0100
@@ -11,7 +11,8 @@
"
Object subclass:#Exception
- instanceVariableNames:'signal parameter suspendedContext handlerContext
+ instanceVariableNames:'signal parameter errorString
+ suspendedContext handlerContext
resumeBlock rejectBlock'
classVariableNames:'EmergencyHandler'
poolDictionaries:''
@@ -23,7 +24,7 @@
COPYRIGHT (c) 1993 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.4 1993-12-11 00:46:23 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.5 1994-01-16 03:40:24 claus Exp $
'!
!Exception class methodsFor:'documentation'!
@@ -47,7 +48,24 @@
restart - restart the Signal>>handle:do:, after repairing
Via the Exception object, the handler can also query the state of execution,
-where the Signal was raised.
+where the Signal was raised, where the handler is, the signal which caused
+the error and the errorString passed when the signal was raised:
+
+instance variables:
+ signal - the signal which caused the exception
+ parameter - a parameter (if any) which was passed when raising
+ the signal (only if raised with #raiseWith:aParameter)
+
+ errorString - an errorString (only if raised wiith #raiseWith:errorString:)
+ suspendedContext- the context where the signal raise occured
+ handlerContext - the context of the handler itself
+
+ resumeBlock - private to the exception; needed to perform resume action
+ rejectBlock - private to the exception; needed to perfomr reject action
+
+No Emergency mechanism is currently implemented - an unhandled signal currently
+goes always into the debugger; the method found dealing with it exist only
+for compatibility reasons only.
"
! !
@@ -81,27 +99,47 @@
^ signal
!
-parameter:aParameter
- parameter := aParameter
-!
+parameter
+ "return the parameter passsed with the signal raise
+ (or nil, if there was none)"
-parameter
^ parameter
!
+errorString
+ "return the errorString passsed with the signal raise
+ (or nil, if there was none)"
+
+ ^ errorString
+!
+
+handlerContext
+ "return the context of the handler"
+
+ ^ handlerContext
+!
+
suspendedContext
+ "return the context in which the raise occured"
+
+ ^ suspendedContext
! !
!Exception methodsFor:'setup'!
-signal:aSignal
- "this is meant to be sent by Signal only"
+signal:aSignal parameter:aParameter errorString:aString suspendedContext:sContext
+ "set the fields usable for inspection by the handler
+ - only to be sent from the signal when raising"
- signal := aSignal
+ signal := aSignal.
+ parameter := aParameter.
+ errorString := aString.
+ suspendedContext := sContext.
!
handlerContext:aContext
- "this is meant to be sent by Signal only"
+ "set the context of the handler.
+ - only to be sent from the signal when raising"
handlerContext := aContext
!