Exception.st
changeset 4480 9b7616845592
parent 4478 782108345281
child 4481 f3f7e1af7489
--- a/Exception.st	Sat Jul 31 16:36:41 1999 +0200
+++ b/Exception.st	Sat Jul 31 18:12:36 1999 +0200
@@ -1174,7 +1174,9 @@
      This is only valid during handler execution.
      (i.e. an outer handler can find out, if any other handler has already
      rejected).
-     "
+     Currently only used to change the 'unhandled-exception' errorString 
+     into 'rejected-exception' for information).
+    "
 
     ^ rejected
 !
@@ -1371,8 +1373,33 @@
     "handler decided not to handle this signal -
      system will look for another handler"
 
+"/    |con|
+"/
+"/    "/ find my raise context
+"/    con := thisContext findSpecialHandle:false raise:true.
+"/    [con notNil and:[con receiver ~~ self]] whileTrue:[
+"/        con := con findSpecialHandle:false raise:true.
+"/    ].
+"/    rejected := true.
+"/    con unwind:nil.
+"/self halt.
+
     rejected := true.
     rejectBlock value
+
+    "
+     Object errorSignal handle:[:ex |
+        '1' printCR.
+        ex reject
+     ] do:[
+        Object errorSignal handle:[:ex |
+            '2' printCR.
+            ex reject
+        ] do:[
+            #() at:1
+        ]
+     ]
+    "
 !
 
 restart
@@ -1649,7 +1676,7 @@
     "Created: / 25.7.1999 / 20:13:19 / stefan"
 !
 
-doCallHandler:aHandler
+doCallHandler:aHandlerBlock
     "call the handler proper - needed an extra method
      to have a separate returnContext for the rejectBlock.
      (which is historical, and actually no longer needed)"
@@ -1660,7 +1687,7 @@
 
     thisContext markForRaise.
 
-    val := aHandler value:self.
+    val := aHandlerBlock value:self.
     "
      handler fall through - is just like a returnWith:blocks-value
     "
@@ -1796,10 +1823,12 @@
                 "/ remember the handling signal, sigSet, or exception
                 "/ for the #accepts: check above
                 handlingSignal := r handlingExceptionInContext:theContext.
+                theContext := nil.
                 self doCallHandler:handler.
 
                 "/ if the handler rejects, we arrive here
                 "/ continue search for another handler
+                theContext := handlerContext.
             ].
         ].
         theContext := theContext findSpecialHandle:true raise:false.
@@ -1901,6 +1930,6 @@
 !Exception class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.75 1999-07-31 14:34:56 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.76 1999-07-31 16:12:36 cg Exp $'
 ! !
 Exception initialize!