I know that the implementation signals a MessageNotUnderstood
exception, but how does that end up opening a debugger?
1 Answer
When an Exception remains unhandled after it has been signalled, its #defaultAction
is invoked. MessageNotUnderstood>>defaultAction delegates to Error>>defaultAction, which signals an UnhandledError
(another Exception). This exception, in turn, has a defaultAction whose code reads like this:
^ ToolSet debugError: self exception
...which opens the debugger if you use the StandardToolSet (which is the default in regular Squeak images).
-
I'm wondering what invokes #defaultAction? I suspect that it's invoked from
UndefinedObject>>handleSignal:
when there are no more exception handlers in the call chain. Is this true? Or, is the VM sending that message when no more handlers remain? Commented Jul 16, 2018 at 15:46 -
@rationalrevolt Yes, it's true. The VM isn't involved in the way exceptions are handled. Commented Jul 16, 2018 at 19:09