<div dir="ltr">Hi Tim and Levente,<br><br>IMO, the shortcoming is in the class library not strictly and clearly defining a Notification as an output, while providing a separate, resumable Request, for input.  Because of that, over time, clients (mis)used Notification as a way to dynamically request input, with inconsistent use of #defaultAction to either resume with a defaultValue, or pop up a UI that simply <u>returns</u> a value (without resuming).<br><br>This has basically rendered any and all handling of Notification impossible to be correct for all cases.  It has no way to tell them apart, which is the responsibility of the signalers, not the handler.  So Notification essentially became a catch-all common-superclass "categorizer"...  and a very bad one, at that.<div><div><br></div><div>As long as Notification>>#defaultAction remains </div><div><br></div><div>    ^nil </div><div><br></div><div>instead of </div><div><br></div><div>      self resume</div><div><br></div><div>then Smalltalk>>#run: <u>must</u> handle Notification, otherwise, what Tim said would happen with headless apps, will happen.</div><div><br></div><div>Tim, I'm sure you've figured that those Metacello exceptions can be handled within your run: block.  Something like:</div><div><br></div><div>Smalltalk run:</div><div>     [ ...</div><div>     [ ensureMetacello ] on: MetacelloNotification do: [ : noti | noti defaultAction ].</div><div>     ... ]</div><div><br></div><div>I agree, you shouldn't have to, it'd be so much nicer if they'd inherited from something besides Notification...</div><div><br></div><div> - Chris<br><br><br>On Thu, Jul 16, 2020 at 7:50 AM Levente Uzonyi <<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>> wrote:<br>><br>> On Wed, 15 Jul 2020, tim Rowledge wrote:<br>><br>> ><br>> ><br>> >> On 2020-07-15, at 7:09 PM, Levente Uzonyi <<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>> wrote:<br>> >><br>> >> On Wed, 15 Jul 2020, tim Rowledge wrote:<br>> >><br>> >>> Running Installer ensureRecentMetacello works. (in a 5.3-19435 image)<br>> >>><br>> >>> Wrapping it in Smalltalk run:[Installer ensureRecentMetacello ]<br>> >>> crashes. Specifically in MetacelloScriptEngine>>#lookupProjectSpecFor: we find that 'registration' is nil on the last line.<br>> >>> Seems a bit odd; possibly sometihng to do with the assorted exception handling in the SmalltalkImage>run: code?<br>> >><br>> >> I think the cause of the problem is that SmalltalkImage >> #run: catches all Notifications, logs them, and finally #resumes them.<br>> >> But many Notifications override #defaultAction, and the return value of that method will be the value the Notification normally returns with when not handled.<br>> >> #resume does not send #defaultAction (it sends #defaultResumeValue, which is rarely used).<br>> ><br>> > Sounds pretty likely to me. It's another of those 'fun' cases where one tries to handle errors that you don't necessarily know how to handle. Almost always a problem. I think I have a sigline about that mistake.<br>> ><br>> ><br>> >><br>> >> IMO the code should not #resume the Notifications just #pass them, so that they can return with whatever they want (or be handled by an outer handler).<br>> ><br>> > Except that surely the problem then becomes that the default action of many Notification type exceptions is to do some UI thing, and the entire point of the run: stuff is to avoid that so it can be a commandline no-UI activity. ;-)<br>><br>> AFAIK that is why DummyUIManager exists. It lets you provide answers to<br>> these questions (via Notifications :)) or go with a default value if<br>> possible.<br>><br>><br>> Levente<br>><br>> ><br>> > Is it a case of a different type of exception being the right way of doing it within the metacello load code?  I see several Metacello exception classes under Notification, mostly with #defaultAction returning a boolean. Don't see any current exception class that really covers the 'give me a default boolean answer' case.<br>> ><br>> > Exception handling is *such* fun!<br>> ><br>> > tim<br>> > --<br>> > tim Rowledge; <a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" target="_blank">http://www.rowledge.org/tim</a><br>> > Useful Latin Phrases:- Ne auderis delere orbem rigidum meum! = Don't you dare erase my hard disk!<br>></div></div></div>