--- a/GenericException.st Tue May 28 00:23:55 2013 +0100
+++ b/GenericException.st Fri May 31 00:35:21 2013 +0100
@@ -1191,12 +1191,9 @@
!
creator
- "return the creator of the exception;
- same as signal, for compatibility"
-
- ^ signal ? self class
-
- "Modified: / 10-08-2010 / 09:23:18 / cg"
+ "return the creator of the exception"
+
+ signal notNil ifTrue:[^ signal] ifFalse:[^ self class]
!
errorString
@@ -1393,10 +1390,7 @@
the creator. Marked as obsolete, until the change is done!!"
self obsoleteMethodWarning:'meaning of #signal will change. Use #creator'.
-
- ^ signal ? self class
-
- "Modified: / 10-08-2010 / 09:22:33 / cg"
+ ^ self creator.
!
suspendedContext
@@ -1457,7 +1451,7 @@
"
try per signal handler
"
- (handlerBlock := signal handlerBlock) notNil ifTrue:[
+ (handlerBlock := self creator handlerBlock) notNil ifTrue:[
"... and call it"
^ handlerBlock value:self.
].
@@ -1686,9 +1680,12 @@
|con|
con := handlerContext.
- thisContext evaluateUnwindActionsUpTo:con.
handlerContext := suspendedContext := raiseContext := nil.
- con restart
+ con unwindAndRestart.
+
+"/ thisContext evaluateUnwindActionsUpTo:con.
+"/ handlerContext := suspendedContext := raiseContext := nil.
+"/ con restart
"
|rslt n|
@@ -1719,9 +1716,11 @@
"/ ].
con receiver handlerProtectedBlock:aBlock inContext:con.
- thisContext evaluateUnwindActionsUpTo:con.
+"/ thisContext evaluateUnwindActionsUpTo:con.
+"/ handlerContext := suspendedContext := raiseContext := nil.
+"/ con restart
handlerContext := suspendedContext := raiseContext := nil.
- con restart
+ con unwindAndRestart.
"
|sig rslt|
@@ -1794,7 +1793,7 @@
return
"Continue after the handle:do: - the handle:do: returns nil"
- |con|
+ |con value|
con := handlerContext.
"/ cg: moving the following clearing of the handlerContext
@@ -1806,10 +1805,11 @@
"/ these are unmarkedForUnwind anyway, so there should be no danger
"/ for endless recursion here... (i.e. each unwind action can at most
"/ reraise that exception once).
+ value := self defaultReturnValue. "/ evaluate before unwinding
handlerContext := suspendedContext := raiseContext := nil.
thisContext evaluateUnwindActionsUpTo:con.
"/ handlerContext := suspendedContext := raiseContext := nil.
- con return:(self defaultReturnValue)
+ con return:value
"Modified: / 7.9.2001 / 13:29:34 / cg"
!
@@ -1881,8 +1881,8 @@
|sigDescr|
- sigDescr := signal description.
- (messageText isNil or:[ messageText isString not])
+ sigDescr := self creator description.
+ (messageText isNil or:[messageText isString not])
ifTrue:[
^ sigDescr
].
@@ -1923,7 +1923,7 @@
self mayProceed ifFalse:[
StrictRaising ifTrue:[
"/ proceeding from wrongProceedabilitySignal grants the raiseRequest
- WrongProceedabilityError raiseRequestWith:signal
+ WrongProceedabilityError raiseRequestWith:self creator.
] ifFalse:[
self class name infoPrint.
' [warning]: raised with wrong proceedability' infoPrintCR.
@@ -1984,16 +1984,16 @@
"is nil a valid originator? If so, we need an extra
instanceVariable to record the originator setting"
-
originator isNil ifTrue:[
originator := suspendedContext homeReceiver
].
+
signal isNil ifTrue:[
signal := self class
] ifFalse:[
signal isExceptionCreator ifFalse:[
"not an exception or Signal - there is something wrong here..."
- Error "GenericException" raiseWith:signal errorString:'unexpected non-ExceptionCreator in calling context'.
+ SignalError raiseWith:signal errorString:'unexpected non-ExceptionCreator in calling context'.
]
].
@@ -2018,9 +2018,12 @@
Maybe we should better treat a default action like a #handle:do:
at the outest level. But the DebugView currently can't handle this,
because it tries to raise e.g. AbortOperationRequest even if it has bee invoked
- by e.g. NoHandlerError"
-
- (ex1 creator == signal) ifTrue:[
+ by e.g. NoHandlerError.
+
+ Note that if raiseContext is nil, the exception
+ did already return."
+
+ (ex1 creator == signal and:[ex1 raiseContext notNil]) ifTrue:[
"the same exception that has been cought by a default action is raised again.
don't recurse"
^ self noHandler.
@@ -2294,8 +2297,6 @@
signal := aSignal.
!
-
-
suspendedContext:sContext errorString:aString
"set required fields
- only to be sent from the signal when raising"
@@ -2353,11 +2354,11 @@
!GenericException class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.139 2013-05-21 20:26:48 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.141 2013-05-27 14:13:24 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.139 2013-05-21 20:26:48 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.141 2013-05-27 14:13:24 stefan Exp $'
!
version_HG