<div dir="auto"><div><a href="https://tech.labs.oliverwyman.com/blog/2011/01/04/try-again-with-exceptions/">https://tech.labs.oliverwyman.com/blog/2011/01/04/try-again-with-exceptions/</a></div><div dir="auto"><br></div><div dir="auto">described the fun I had with that method nearly exactly 8 years ago!</div><div dir="auto"><br></div><div dir="auto">frank<br><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Mon, Dec 31, 2018, 16:48 tim Rowledge <<a href="mailto:tim@rowledge.org">tim@rowledge.org</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I was taking a swing at fixing the FileBrowser bug caused by the non-existence of <a href="http://st.cs.uiuc.edu" rel="noreferrer noreferrer" target="_blank">st.cs.uiuc.edu</a> wherein we get a very annoying loop of notifiers and a hard time trying to get out of them. Looking around the related code suggests we really want to clean up a lot of methods to do with serverdirectory, ftpurl etc.<br>
<br>
The error handling bug is quite simple to trigger for you pleasure and amusement (I'm past being amused by it and have gone around enough times that I think I can no longer see the wood for the trees)<br>
<br>
 NetNameResolver addressForName: '<a href="http://st.cs.uiuc.edu" rel="noreferrer noreferrer" target="_blank">st.cs.uiuc.edu</a>' timeout: 10.<br>
<br>
should do it for you.<br>
The problem is that we get to NameLookupFailure>defaultAction (because there is no other handler), which uses a UI to ask if the user wants to try again (sigh; raising a UI from a system error...) and if the option to retry is picked then it sends #restart to the handlerContext - which is not set. So far as I can see handlerContext only gets set by sending #privHandlerContext: which is only done just *after* the code that we just ran to get into trouble. With no set handlerContext we're also in trouble if we want to #pass, #return: or even just query #isNested.<br>
<br>
If we use a 'deliberate' handler it works as one might hope<br>
 [NetNameResolver addressForName: '<a href="http://st.cs.uiuc.edu" rel="noreferrer noreferrer" target="_blank">st.cs.uiuc.edu</a>' timeout: 10] on: NameLookupFailure do:[:ex| ex pass].<br>
So, maybe an edge case that got over-optimised? Like I said, my brain is now useless for this and it needs another set of eyes.<br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org" target="_blank" rel="noreferrer">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
Strange OpCodes: FSRA: Forms Skip and Run-Away<br>
<br>
<br>
<br>
</blockquote></div></div></div>