GenericException.st
branchjv
changeset 21024 8734987eb5c7
parent 20578 39641ba8d6e0
parent 20800 1682d2103d21
child 21042 edb2e7f82c62
--- a/GenericException.st	Wed Oct 26 23:35:39 2016 +0100
+++ b/GenericException.st	Fri Nov 18 20:48:04 2016 +0000
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
@@ -132,7 +130,7 @@
         and NON-PROCEEDABLE signals must be raised with:
             raise
 
-        If you dont know/care as a raiser, you can use
+        If you don't know/care as a raiser, you can use
             raiseSignal
         which checks for proceedability and sends the appropriate message.
         (sigh)
@@ -226,7 +224,6 @@
     self raiseErrorString:messageText
 ! !
 
-
 !GenericException class methodsFor:'accessing'!
 
 errorString
@@ -956,33 +953,33 @@
 
      Deferring makes sense for some signals, such as UserInterrupt or AbortSignal,
      which must occasionally be delayed temporarily until a save place is reached
-     (especially when packages are sent across a communication channel, and you dont want
+     (especially when packages are sent across a communication channel, and you don't want
       partial packages to be generated by user interruptions)."
 
     |caughtException result|
 
     self handle:[:ex |
-	caughtException isNil ifTrue:[
-	    caughtException := ex.
-	].
-	ex proceedWith:nil
+        caughtException isNil ifTrue:[
+            caughtException := ex.
+        ].
+        ex proceedWith:nil
     ] do:[
-	result := aBlock value.
+        result := aBlock value.
     ].
     caughtException notNil ifTrue:[
-	caughtException suspendedContext:thisContext.
-
-	"/ the exception was raised during the execution of aBlock above.
-	"/ Raise it now (delayed).
-	caughtException raiseSignal.
+        caughtException suspendedContext:thisContext.
+
+        "/ the exception was raised during the execution of aBlock above.
+        "/ Raise it now (delayed).
+        caughtException raiseSignal.
     ].
     ^ result
 
     "
      UserInterrupt deferAfter:[
-	 Transcript showCR:'1 - now raising, but will be deferred.'.
-	 UserInterrupt raiseRequestWith:'hello'.
-	 Transcript showCR:'2 - after the raise, deferred exception will be handled soon.'.
+         Transcript showCR:'1 - now raising, but will be deferred.'.
+         UserInterrupt raiseRequestWith:'hello'.
+         Transcript showCR:'2 - after the raise, deferred exception will be handled soon.'.
      ].
      Transcript showCR:'3 - here after the protected block.'.
     "
@@ -1222,6 +1219,9 @@
 !GenericException methodsFor:'Compatibility-Squeak'!
 
 signalerContext
+    "return the context in which the raise occurred.
+     Same as suspendedContext, for squeak compatibility"
+     
     ^ self suspendedContext
 ! !