Hi Christoph,
I would have liked to use #isResumable rather than Exception vs Error to determine whether something should be caught to reject the promise, or to let it pass. Unfortunately, ZeroDivide is declared as resumable... so future divisions by zero would not reject promises as they used to.
Changing fulfillWith:passErrors: to only catch Error instead of Exception lets all tests still pass on my side. It also makes this new one (in FutureTest) green:
testNotificationsAreNotCaught "The deferred evaluation below uses CurrentReadOnlySourceFiles. The error handling of the future promise must not interfere with this Exception." | p1 | p1 := Object future comment. self waitUntil: [p1 isResolved] orCycleCount: 1. self assert: p1 isResolved.
You could change the fulfill method accordingly and see whether you encounter any strange behavior during the next few weeks. Or have you already done it?
In general, the change seems right to me, as there are many examples of Exceptions that are not supposed to be caught (like IllegalResumeAttempt, TestFailure), or are not meant to abort any control flow (ProgressNotification, MCNoChangesException).
Kind regards, Jakob
Am Do., 24. Aug. 2023 um 03:21 Uhr schrieb Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de:
Hi Jakob,
short answer only at the current time, but thank you for looking into this!
Can you please provide a concrete example for this? Maybe we can at least find a solution for this aspect quicker than for all the rest.
Object future comment ifRejected: #halt.
A workaround might be only catching Error or Error , Warning in Promise>>#fulfillWith:passErrors: but not Exception, I guess ...
Best,
Christoph
Von: Jakob Reschke jakres+squeak@gmail.com Gesendet: Mittwoch, 23. August 2023 23:23:27 An: The general-purpose Squeak developers list Betreff: [squeak-dev] Re: On the rejection of Promises due to errors
Am Fr., 18. Aug. 2023 um 21:06 Uhr schrieb christoph.thiede@student.hpi.uni-potsdam.de:
Most importantly, you must never catch Exceptions instead of Errors but the current implementation does so. At the moment, we cannot even access any source files from a promise due to CurrentReadOnlySourceFiles.
Can you please provide a concrete example for this? Maybe we can at least find a solution for this aspect quicker than for all the rest.