[Newbies] Exception question

Erlis Vidal erlis at erlisvidal.com
Thu Apr 14 18:42:32 UTC 2011


I've been reading about the smalltalk exceptions thanks to some suggestions
received in this list.

While  reading
9) I found the implementation for
*Object>>doesNotUnderstand *but there is something I don't understand and
I'm wondering if someone can help me.

Object»doesNotUnderstand: aMessage
"Handle the fact that there was an attempt to send the given message to the
but the receiver does not understand this message (typically sent from the
when a message is sent to the receiver and no method is defined for that
MessageNotUnderstood new
message: aMessage;
receiver: self;
↑ aMessage sentTo: self.

I'm having problem with the line in red. The method is pretty simple, it
just create a new MessageNotUnderstood instance and then send the message:
and receiver: messages, but it also *signal *the exception, which I was
thinking will finish the method execution, but if that's the case, Why the
red line? Why returning anything after signaling the exception?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20110414/28f5bbb8/attachment.htm

More information about the Beginners mailing list