Cleanuo in `Smalltalk >> #executeStartBlocks` jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 18 Jan 2017 22:52:31 +0000
branchjv
changeset 21290 1e7175049bbc
parent 21289 7189410cd300
child 21291 ee0044f48b5a
Cleanuo in `Smalltalk >> #executeStartBlocks` * Use `Logger` instead of (obsolete) infoPrintCR: * Remove start block before it's executed. This simplifies cases where start block actually calls `Smalltalk >> #exit:`
Smalltalk.st
--- a/Smalltalk.st	Wed Jan 18 10:18:09 2017 +0000
+++ b/Smalltalk.st	Wed Jan 18 22:52:31 2017 +0000
@@ -3893,21 +3893,22 @@
 
     startBlocks := self startBlocks.
     startBlocks notNil ifTrue:[
-	'Smalltalk [info]: execute startBlocks...' infoPrintCR.
-	startBlocks do:[:aBlock|
-	    Error handle:[:ex |
-		InfoPrinting == true ifTrue:[
-		    'Smalltalk [warning]: error caught in startBlock: ' infoPrint.
-		    ex description infoPrintCR.
-		    ex infoPrintCR.
-		    thisContext fullPrintAll.
-		].
-	    ] do: aBlock
-	].
-	startBlocks removeAll.
+        Logger info: 'Executing start blocks'.
+        startBlocks copy do:[:aBlock|
+            startBlocks remove: aBlock.    
+            aBlock on: Error do:[:ex |
+                Logger error: 'Error when executing start block: %1' with: ex description.
+                InfoPrinting == true ifTrue:[
+                    ex description infoPrintCR.
+                    ex infoPrintCR.
+                    thisContext fullPrintAll.
+                ].
+            ]
+        ].
     ].
 
     "Created: / 07-01-2012 / 12:58:39 / cg"
+    "Modified: / 18-01-2017 / 22:45:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 hideSplashWindow