On Fri, Sep 7, 2012 at 10:17 AM, Joe Rickerby <joe.rickerby@square-i.net>wrote:
Hi all,
I'm having a problem trying to build a run loop. If an exception is signalled within one of the run loop tasks, the exception escapes through the loop and terminates the process.
I know I can catch the exception, and do something like print the message on the Transcript, but I was hoping to build something that was more helpful in development, allowing me to look through the stack, but if I press 'abandon' on that dialog, the run loop would continue from where I caught the exception.
Try with Exception >> #resume
The code:
*startRunLoop* self stopRunLoop. self runLoop: ( [ [ self doTimedTasks ] on: Exception do: [ :err | " show the exception notifier "
err resume
] ] repeatEvery: 0.1 seconds named: 'BrTimeline run loop' )
where repeatEvery:named: is implemented as such:
*repeatEvery:* aDuration *named:* aProcessName ^ [ [ self value. aDuration asDelay wait ] repeat ] forkNamed: aProcessName
Thanks, Joe
-- Mariano http://marianopeck.wordpress.com