--- a/Exception.st Fri Mar 22 15:51:36 1996 +0100
+++ b/Exception.st Sat Mar 23 17:16:47 1996 +0100
@@ -11,11 +11,11 @@
"
Object subclass:#Exception
- instanceVariableNames:'signal parameter errorString suspendedContext handlerContext
+ instanceVariableNames:'signal parameter errorString suspendedContext handlerContext
rejected originator resumeBlock rejectBlock'
- classVariableNames:'EmergencyHandler RecursiveExceptionSignal'
- poolDictionaries:''
- category:'Kernel-Exceptions'
+ classVariableNames:'EmergencyHandler RecursiveExceptionSignal'
+ poolDictionaries:''
+ category:'Kernel-Exceptions'
!
!Exception class methodsFor:'documentation'!
@@ -353,61 +353,61 @@
con := thisContext sender. "the raise-context"
con := con sender. "the signal raise context"
con isRecursive ifTrue:[
- "
- mhmh - an error while in a handler
- "
- ((signal == RecursiveExceptionSignal)
- or:[RecursiveExceptionSignal isNil]) ifTrue:[
- "
- ... either while handling RecursiveExceptionSignal
- or at startup when RecursiveExceptionSignal is not yet
- created -
- - go immediately into the debugger.
- "
- ^ self enterDebuggerWith:self
- message:'recursive signal raise'
- ].
- ^ RecursiveExceptionSignal
- raiseRequestWith:self
- errorString:('recursive signal raise: ' , errorString)
+ "
+ mhmh - an error while in a handler
+ "
+ ((signal == RecursiveExceptionSignal)
+ or:[RecursiveExceptionSignal isNil]) ifTrue:[
+ "
+ ... either while handling RecursiveExceptionSignal
+ or at startup when RecursiveExceptionSignal is not yet
+ created -
+ - go immediately into the debugger.
+ "
+ ^ self enterDebuggerWith:self
+ message:'recursive signal raise'
+ ].
+ ^ RecursiveExceptionSignal
+ raiseRequestWith:self
+ errorString:('recursive signal raise: ' , errorString)
].
any := false.
[con notNil] whileTrue:[
- con isBlockContext ifFalse:[
- sel := con selector.
- sel == #doCallHandler: ifTrue:[
- activeHandler := con argAt:1
- ].
+ con isBlockContext ifFalse:[
+ sel := con selector.
+ sel == #doCallHandler: ifTrue:[
+ activeHandler := con argAt:1
+ ].
- ((sel == #'handle:do:')
- or:[((sel == #'handle:from:do:')
- and:[(con argAt:2) == originator])]) ifTrue:[
- "
- if this is the Signal>>handle:do: context
- or a SignalSet>>handle:do: context with self in it,
- call the handler
- "
- (con receiver accepts:signal) ifTrue:[
- "call the handler"
+ ((sel == #'handle:do:')
+ or:[((sel == #'handle:from:do:')
+ and:[(con argAt:2) == originator])]) ifTrue:[
+ "
+ if this is the Signal>>handle:do: context
+ or a SignalSet>>handle:do: context with self in it,
+ call the handler
+ "
+ (con receiver accepts:signal) ifTrue:[
+ "call the handler"
- conArg1 := con argAt:1.
- activeHandler == conArg1 ifTrue:[
+ conArg1 := con argAt:1.
+ activeHandler == conArg1 ifTrue:[
"/ 'skip active handler:' print.
"/ con print. ' ' print. con receiver print.
"/ ' for ' print. signal printNL
- ] ifFalse:[
- handlerContext := con.
- any := true.
- self doCallHandler:conArg1.
+ ] ifFalse:[
+ handlerContext := con.
+ any := true.
+ self doCallHandler:conArg1.
- "if the handler rejects, we arrive here"
- "continue search for another handler"
- ]
- ].
- ]
- ].
- con := con sender
+ "if the handler rejects, we arrive here"
+ "continue search for another handler"
+ ]
+ ].
+ ]
+ ].
+ con := con sender
].
"
@@ -418,27 +418,32 @@
try per signal handler
"
(block := signal handlerBlock) isNil ifTrue:[
- "
- if it is not the NoHandlerSignal, raise it ...
- passing the receiver as parameter.
- "
+ "/
+ "/ if its a querySIgnal, ignore it
+ "/
+ signal isQuerySignal ifTrue:[^ self].
+
+ "/
+ "/ if it is not the NoHandlerSignal, raise it ...
+ "/ passing the receiver as parameter.
+ "/
signal ~~ (noHandlerSignal := Signal noHandlerSignal) ifTrue:[
- noHandlerSignal notNil ifTrue:[
- any ifTrue:[
- msg := 'unhandled (rejected)'
- ] ifFalse:[
- msg := 'unhandled'
- ].
- ^ noHandlerSignal
- raiseRequestWith:self
- errorString:(msg , ' exception: ' , errorString)
- in:self suspendedContext
- ].
- "
- mhmh - an error during early startup; noHandlerSignal is
- not yet defined.
- "
- ^ MiniDebugger enterWithMessage:errorString
+ noHandlerSignal notNil ifTrue:[
+ any ifTrue:[
+ msg := 'unhandled (rejected)'
+ ] ifFalse:[
+ msg := 'unhandled'
+ ].
+ ^ noHandlerSignal
+ raiseRequestWith:self
+ errorString:(msg , ' exception: ' , errorString)
+ in:self suspendedContext
+ ].
+ "/
+ "/ mhmh - an error during early startup; noHandlerSignal is
+ "/ not yet defined.
+ "/
+ ^ MiniDebugger enterWithMessage:errorString
].
"
@@ -448,19 +453,21 @@
or the global emergencyHandler (from Exception) ...
"
Processor notNil ifTrue:[
- "care for signal during startup (Processor not yet created)"
- block := Processor activeProcess emergencySignalHandler.
+ "care for signal during startup (Processor not yet created)"
+ block := Processor activeProcess emergencySignalHandler.
].
block isNil ifTrue:[
- block := Exception emergencyHandler.
+ block := Exception emergencyHandler.
block isNil ifTrue:[
- "care for error during startup (Exception not yet initialized)"
- ^ MiniDebugger enterWithMessage:errorString
+ "care for error during startup (Exception not yet initialized)"
+ ^ MiniDebugger enterWithMessage:errorString
].
].
].
"... and call it"
^ block value:self.
+
+ "Modified: 23.3.1996 / 17:16:13 / cg"
!
raise
@@ -494,6 +501,6 @@
!Exception class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.32 1996-02-28 23:26:41 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.33 1996-03-23 16:16:47 cg Exp $'
! !
Exception initialize!