DebugView.st
changeset 18598 eaed5dce5c8d
parent 18593 26507bc67fde
child 18601 370b48d708b1
--- a/DebugView.st	Sun Feb 17 15:46:07 2019 +0100
+++ b/DebugView.st	Mon Feb 18 12:31:50 2019 +0100
@@ -3965,6 +3965,15 @@
 !
 
 setLabelFor:errorDescriptionMessage in:aProcess
+    self setLabelFor:errorDescriptionMessage in:aProcess orElseInLocation:''
+
+    "Modified: / 03-12-2017 / 15:09:55 / cg"
+    "Modified: / 18-02-2019 / 12:02:42 / Claus Gittinger"
+!
+
+setLabelFor:errorDescriptionMessage in:aProcessOrNil orElseInLocation:aLocationString
+    "set the window-title and the exceptionInfo label's string"
+    
     |l lines processNameOrNil pidOrNil osPidString colorUsed|
 
     lines := errorDescriptionMessage asStringCollection.
@@ -3974,18 +3983,20 @@
         l := errorDescriptionMessage.
     ].
 
-    l := l , ' ('.
-    Error handle:[:ex |
-        l := l , '???'
-    ] do:[
-        processNameOrNil := aProcess name.
-        processNameOrNil notNil ifTrue:[
-            l := l , (processNameOrNil contractTo:20) , ''.
-        ].
-        pidOrNil := aProcess id printString.
-        l := l , '[' , pidOrNil , ']'.
-    ].
-    l := l , ')'.
+    aProcessOrNil notNil ifTrue:[
+        l := l , ' ('.
+        Error handle:[:ex |
+            l := l , '???'
+        ] do:[        
+            processNameOrNil := aProcessOrNil name.
+            processNameOrNil notNil ifTrue:[
+                l := l , (processNameOrNil contractTo:20) , ''.
+            ].
+            pidOrNil := aProcessOrNil id printString.
+            l := l , '[' , pidOrNil , ']'.
+        ].
+        l := l , ')'.
+    ].    
     self label:l.
 
     ((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[
@@ -3997,21 +4008,30 @@
                         ifTrue:[ Color orange ]
                         ifFalse:[ Color red ].
         colorUsed := colorUsed contrastingColorFor:exceptionInfoLabel backgroundColor.                
+
+        processNameOrNil notNil ifTrue:[
+            exceptionInfoLabel
+                label:(resources
+                        string:'%1 in process %2 [%3]%4'
+                        with:(lines first withColor:colorUsed)
+                        with:(processNameOrNil ? '')
+                        with:(pidOrNil ? '')
+                        with:(osPidString ? '')).
+        ] ifFalse:[
+            exceptionInfoLabel
+                label:(resources
+                        string:'%1 in %2%3'
+                        with:(lines first withColor:colorUsed)
+                        with:aLocationString
+                        with:(osPidString ? '')).
+        ].
         
-        exceptionInfoLabel
-            label:(resources
-                    string:'%1 in process %2 [%3]%4'
-                    with:(lines first withColor:colorUsed)
-                    with:(processNameOrNil ? '')
-                    with:(pidOrNil ? '')
-                    with:(osPidString ? '')).
-
         exceptionInfoLabel 
             helpText:(((resources stringWithCRs:'Error description:\') withColor:Color gray)
                           ,(lines asStringWith:Character cr)).
     ].
 
-    "Modified: / 03-12-2017 / 15:09:55 / cg"
+    "Created: / 18-02-2019 / 12:02:11 / Claus Gittinger"
 ! !
 
 !DebugView methodsFor:'interrupt handling'!