[Cuis-dev] catch of MessageNotUnderstood

ken.dickey at whidbey.com ken.dickey at whidbey.com
Sun Jun 30 15:48:01 PDT 2024


On 2024-06-30 14:48, Mark Volkmann via Cuis-dev wrote:

> I'm studying how the doesNotUnderstand method is used. I see that the 
> implementation in the Object class signals a MessageNotUnderstood 
> error. But I haven't been able to find the code that catches that and 
> opens a MessageNotUnderstood window. Where does that happen?

You have to follow the chain.  Take the #defaultAction.

===========
MessageNotUnderstood>>defaultAction
	reachedDefaultHandler := true.
	super defaultAction
===========
Error>>defaultAction

	self noHandler
===========
Exception>>noHandler
	"No one has handled this error, but now give them a chance to decide 
how to debug it.  If none handle this either then open debugger (see 
UnhandedError-defaultAction)"

	UnhandledError signalForException: self
============
Exception>>defaultAction
	"The current computation is terminated. The cause of the error should 
be logged or reported to the user. If the program is operating in an 
interactive debugging environment the computation should be suspended 
and the debugger activated."

	Smalltalk isDevelopmentEnvironmentPresent
		ifTrue: [ self devDefaultAction ]
		ifFalse: [ self standaloneAppDefaultAction ]
=============
UnhandledError>>devDefaultAction

	Processor activeProcess
		debugContext: exception signalerContext
		title: exception description.
=============
Here you are in the debugger.

HTH,
-KenD



More information about the Cuis-dev mailing list