Exception handling question

Anthony Hannan ajh18 at cornell.edu
Mon Aug 4 17:00:57 UTC 2003


Roel Wuyts <wuyts at iam.unibe.ch> wrote:
> > The most important point however is that Exception DOES NOT
> > handle Halt (in spite of the fact that Halt is a subclass of 
> > Exception.)
> Can somebody motivate this decision (or whether it is an unintentional 
> bug)?

I'm not the author but I believe the reason is so "self halt" will
always halt and not be accidentally handled by a earlier Error handler. 
The better solution is probably to not make Halt a subclass of Error but
just a direct subclass of Exception.

By the way, UnhandledError is a new exception class that gets raised in
Error defaultAction when an Error is not handled.  If UnhandledError is
also not handled then its defaultAction is to open the debugger on the
original exception.  This extra level of indirection allows the thread
to control debugger opening.  This was implemented to support a better
way to handle exceptions while stepping through code in the debugger
itself.

Cheers,
Anthony



More information about the Squeak-dev mailing list