Benjamin wrote:
You can evaluate:
StartupLoader default errors
And you get the error kept when scripts are executed :)
Ben
Thanks Ben, but I only get an empty OrderedCollection array: #(nil nil nil nil nil nil nil nil nil nil) firstIndex: 1 lastIndex: 0 btw, I can see three different things that might return and was wondering whether: a. it would be only the names of the error? I already had the name of the error "SyntaxErrorNotification" from the _startupErrors_ temporary variable in "SmalltalkImage>>snapshot:andQuit:" but that was of no use to me since the syntax error in... MCCacheRepository default directory setPathName: 'C:\Apps\Smalltalk\!Shared-Package-Cache' ...is not obvious to me and was unsolvable without stepping through with the debugger b. it would include the context of the error that can be used to step through with the debugger? c. it would be... MCCacheRepository default directory setPathName: _Unmatched string quote_ -> 'C:\Apps\Smalltalk\ cheers, -ben
On Feb 18, 2012, at 12:19 AM, Ben Coman wrote:
When using the following StartupLoader script [1]
StartupLoader default executeAtomicItems: { StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: 'C:\Apps\Smalltalk\!Shared-Package-Cache'.]. }.
I was getting a "syntax error in startup" that I could not identify (is it obvious to others?) This was due to the debugger not opening at the point of error since SmalltalkImage>>executeDeferredStartupActions catches the errors. So I hacked this as follows... deferredStartupActions do: [:each | [ each cull: resuming ] value. "btcdebug on: Halt do: [ :err| Smalltalk logError: '==== Startup Error: ', err description inContext: err signalerContext. errors add: err]"].
and then after a quit and restart the dialog "Syntax error: Unmatched string quote" appeared with... StartupLoader default executeAtomicItems: { StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: _Unmatched string quote_ -> 'C:\Apps\Smalltalk\
So after removing "!" from the folder name the syntax error went away.
So now a few questions...
1. Is there a simpler way to debug the startup scripts that I have missed? If not, can a StartupLoader>>test or similar be implemented which runs the same as at image start time but without the error catching in executeDeferredStartupActions, rather than needing to hack executeDeferredStartupActions as I did.
2. Is it reasonable to set a shared package cache in the startup like I have? Or are there some obvious problems with this that I don't see? I would like to avoid downloading all packages every time unzip a fresh image for testing.
3. Is the invalid "!" fixable (though of course I've worked around it)?
I'll open any required bug entries. This was with Pharo-14333 / cogwin_r2522.zip / Windows 7.
cheers, -ben