[squeak-dev] [Discussion] Warning vs. Halt (or: "Why is a warning a notification?")

Jakob Reschke forums.jakob at resfarm.de
Sat Nov 2 16:36:28 UTC 2019


Marcel Taeumel <marcel.taeumel at hpi.de> schrieb am Sa., 2. Nov. 2019, 13:54:

> Hmmm..... Notifcations that claim to be resumable but require user input
> in #defaultAction feel kind of awkwardly designed...
>

Yes they are. After all they don't really have a default value that should
be automatically determined. Or in other words they must be handled and if
they are not they force you to handle them manually. In that regard they
behave more like Errors, which are manually handled in the debugger. They
are not errors from a functional perspective though.

In that sense, I can also resume any error with "nil" (or "false") if I
> want to....
>

...which is what you get when you press "proceed", right? But you are not
allowed to send #resume or #resume: to them.

#resume with default value does not make much sense for those request
exceptions either.

A more sensible pattern might be:

    value := RequestNotification signal.
    value ifNil: [self showUiRequest].

But you cannot enforce it anyway.

Also these requests are mostly UI situations which want to be unit-testable
and therefore use these exceptions, aren't they? So they might not be
amenable or relevant for catch-all exception handling for server purposes
anyway.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191102/d4000f91/attachment.html>


More information about the Squeak-dev mailing list