changed: #errorNotify:from:allowDebug:
authorsr
Mon, 08 Aug 2011 11:35:16 +0200
changeset 13566 fc4e1055263d
parent 13565 4c0a9ea3a4e1
child 13567 fe6564553977
changed: #errorNotify:from:allowDebug:
Object.st
--- a/Object.st	Sun Aug 07 17:03:52 2011 +0200
+++ b/Object.st	Mon Aug 08 11:35:16 2011 +0200
@@ -526,6 +526,9 @@
 ! !
 
 
+
+
+
 !Object methodsFor:'Compatibility-Dolphin'!
 
 stbFixup: anSTBInFiler at: newObjectIndex
@@ -687,6 +690,8 @@
     "
 ! !
 
+
+
 !Object methodsFor:'accessing'!
 
 _at:index
@@ -1886,6 +1891,7 @@
     ^ self
 ! !
 
+
 !Object methodsFor:'comparing'!
 
 = anObject
@@ -7235,6 +7241,7 @@
     ^ self
 ! !
 
+
 !Object methodsFor:'secure message sending'!
 
 ?: selector
@@ -7837,6 +7844,7 @@
     "
 ! !
 
+
 !Object methodsFor:'synchronized evaluation'!
 
 freeSynchronizationSemaphore
@@ -9194,118 +9202,126 @@
     |currentScreen con sender action boxLabels boxValues default s|
 
     Smalltalk isInitialized ifFalse:[
-	'errorNotification: ' print. aString printCR.
-	aContext sender printAllLevels:10.
-	^ nil
+        'errorNotification: ' print. aString printCR.
+        aContext sender printAllLevels:10.
+        ^ nil
     ].
 
     (Dialog isNil
      or:[Screen isNil
      or:[(currentScreen := Screen current) isNil
      or:[currentScreen isOpen not]]]) ifTrue:[
-	"
-	 on systems without GUI, simply show
-	 the message on the Transcript and abort.
-	"
-	Transcript showCR:aString.
-	AbortOperationRequest raise.
-	"not reached"
-	^ nil
+        "
+         on systems without GUI, simply show
+         the message on the Transcript and abort.
+        "
+        Transcript showCR:aString.
+        AbortOperationRequest raise.
+        "not reached"
+        ^ nil
     ].
 
     Processor activeProcessIsSystemProcess ifTrue:[
-	action := #debug.
-	sender := aContext.
-	Debugger isNil ifTrue:[
-	    '****************** Cought Error while in SystemProcess ****************' errorPrintCR.
-	    thisContext fullPrintAll.
-	    action := #abort.
-	].
+        action := #debug.
+        sender := aContext.
+        Debugger isNil ifTrue:[
+            '****************** Cought Error while in SystemProcess ****************' errorPrintCR.
+            Exception handle:[:ex |
+                'Cought recursive error while printing backtrace' errorPrintCR.
+            ] do:[
+                thisContext fullPrintAll.
+            ].
+            action := #abort.
+        ].
     ] ifFalse:[
-	Dialog autoload.        "in case it's autoloaded"
-
-	Error handle:[:ex |
-	    "/ a recursive error - quickly enter debugger
-	    "/ this happened, when I corrupted the Dialog class ...
-	    ('Object [error]: ' , ex description , ' caught in errorNotification') errorPrintCR.
-	    action := #debug.
-	    ex return.
-	] do:[ |s|
-	    sender := aContext.
-	    sender isNil ifTrue:[
-		sender := thisContext sender.
-	    ].
-	    con := sender.
-
-	    "/ skip intermediate (signal & exception) contexts
-	    DebugView notNil ifTrue:[
-		con := DebugView interestingContextFrom:sender
-	    ].
-
-	    "/ show the first few contexts
-
-	    s := WriteStream with:aString.
-	    s cr; cr.
-	    s nextPutLine:'Calling Chain:'.
-	    s nextPutLine:'--------------------------------------------------------------'.
-	    1 to:25 do:[:n |
-		con notNil ifTrue:[
-		    con printOn:s.
-		    s cr.
-		    con := con sender
-		]
-	    ].
-
-	    boxLabels := #('Proceed').
-	    boxValues := #(#proceed).
-	    default := #proceed.
-
-	    AbortOperationRequest isHandled ifTrue:[
-		default := #abort.
-		boxLabels := boxLabels , #('Abort').
-		boxValues := boxValues , #(#abort).
-		true "allowDebug" ifTrue:[
-		    boxLabels := boxLabels , #('Copy Trace and Abort').
-		    boxValues := boxValues , #(#copyAndAbort).
-		]
-	    ] ifFalse:[
-		true "allowDebug" ifTrue:[
-		    boxLabels := boxLabels , #('Copy Trace and Proceed').
-		    boxValues := boxValues , #(#copyAndProceed).
-		].
-	    ].
-
-	    (allowDebug and:[Debugger notNil]) ifTrue:[
-		boxLabels := boxLabels , #('Debug').
-		boxValues := boxValues , #(#debug).
-		default := #debug.
-	    ].
-
-	    action := Dialog
-		    choose:s contents
-		    label:('Exception [' , Processor activeProcess nameOrId , ']')
-		    image:WarningBox errorIconBitmap
-		    labels:boxLabels
-		    values:boxValues
-		    default:default
-		    onCancel:nil.
-	].
+        Dialog autoload.        "in case it's autoloaded"
+
+        Error handle:[:ex |
+            "/ a recursive error - quickly enter debugger
+            "/ this happened, when I corrupted the Dialog class ...
+            ('Object [error]: ' , ex description , ' caught in errorNotification') errorPrintCR.
+            action := #debug.
+            ex return.
+        ] do:[ |s|
+            sender := aContext.
+            sender isNil ifTrue:[
+                sender := thisContext sender.
+            ].
+            con := sender.
+
+            "/ skip intermediate (signal & exception) contexts
+            DebugView notNil ifTrue:[
+                con := DebugView interestingContextFrom:sender
+            ].
+
+            "/ show the first few contexts
+
+            s := WriteStream with:aString.
+            s cr; cr.
+            s nextPutLine:'Calling Chain:'.
+            s nextPutLine:'--------------------------------------------------------------'.
+            1 to:25 do:[:n |
+                con notNil ifTrue:[
+                    con printOn:s.
+                    s cr.
+                    con := con sender
+                ]
+            ].
+
+            boxLabels := #('Proceed').
+            boxValues := #(#proceed).
+            default := #proceed.
+
+            AbortOperationRequest isHandled ifTrue:[
+                default := #abort.
+                boxLabels := boxLabels , #('Abort').
+                boxValues := boxValues , #(#abort).
+                true "allowDebug" ifTrue:[
+                    boxLabels := boxLabels , #('Copy Trace and Abort').
+                    boxValues := boxValues , #(#copyAndAbort).
+                ]
+            ] ifFalse:[
+                true "allowDebug" ifTrue:[
+                    boxLabels := boxLabels , #('Copy Trace and Proceed').
+                    boxValues := boxValues , #(#copyAndProceed).
+                ].
+            ].
+
+            (allowDebug and:[Debugger notNil]) ifTrue:[
+                boxLabels := boxLabels , #('Debug').
+                boxValues := boxValues , #(#debug).
+                default := #debug.
+            ].
+
+            action := Dialog
+                    choose:s contents
+                    label:('Exception [' , Processor activeProcess nameOrId , ']')
+                    image:WarningBox errorIconBitmap
+                    labels:boxLabels
+                    values:boxValues
+                    default:default
+                    onCancel:nil.
+        ].
     ].
 
     action == #debug ifTrue:[
-	^ Debugger enter:sender withMessage:aString mayProceed:true
+        ^ Debugger enter:sender withMessage:aString mayProceed:true
     ].
     action == #proceed ifTrue:[
-	^ nil.
+        ^ nil.
     ].
     (action == #copyAndProceed
     or:[action == #copyAndAbort]) ifTrue:[
-	s := '' writeStream.
-	sender fullPrintAllOn:s.
-	currentScreen rootView setClipboardText:s contents.
-	action == #copyAndProceed ifTrue:[
-	    ^ nil
-	].
+        s := '' writeStream.
+        Exception handle:[:ex |
+            'Cought recursive error while printing backtrace' errorPrintCR.
+        ] do:[
+            sender fullPrintAllOn:s.
+        ].
+        currentScreen rootView setClipboardText:s contents.
+        action == #copyAndProceed ifTrue:[
+            ^ nil
+        ].
     ].
 
     AbortOperationRequest raise.
@@ -9318,6 +9334,7 @@
 
     "Created: / 17-08-1998 / 10:09:26 / cg"
     "Modified: / 09-12-2010 / 10:22:34 / cg"
+    "Modified: / 08-08-2011 / 11:26:17 / sr"
 !
 
 information:aString
@@ -9417,7 +9434,7 @@
 !Object class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.671 2011-08-07 15:03:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.672 2011-08-08 09:35:16 sr Exp $'
 !
 
 version_SVN