[Newbies] Debug within an error catching block

Bert Freudenberg bert at freudenbergs.de
Sat Dec 11 01:55:15 UTC 2010


On 10.12.2010, at 16:37, Clinton Blackmore wrote:

> Greetings.
> 
> In one area of code, I need to set a break point and do some debugging.  This code is called deeply within a block that is wrapped up so that the end user does not see errors that occur.
> 
> In very simplified form, it is like this:
> 
> [ self error: 'Throwing an error' ] ifError: [:err :rcvr | Transcript show: 'Trapped error']
> 
> When I 'do it', this example will always trap the error instead of breaking into the debugger (which, quit clearly, it is designed to do.)
> 
> While I shudder to think of how easily it could be abused, there is no way to break into a debugger anyway, is there (without finding and disabling the outer block that is sent ifError)?  Perhaps a hypothetical self untrappableError or self bringUpTheDebuggerPlease?

To set a breakpoint do "self halt":

[ self halt. self error: 'Throwing an error' ] ifError: [:err :rcvr | Transcript show: 'Trapped error']

- Bert -


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20101210/34bb81cd/attachment.htm


More information about the Beginners mailing list