[squeak-dev] [ReviewRequest 2] Error-handling and use of `future`

Tony Garnock-Jones tonyg at leastfixedpoint.com
Tue Feb 13 15:48:53 UTC 2018


Hi Marcel,

Thank you for the feedback! It has been helpful. I have a revised
proposal (see below) and updated changeset (attached). If the updated
proposal doesn't strike anyone as problematic, I'll go ahead and commit it.

On 02/13/2018 02:00 PM, Marcel Taeumel wrote:
> I would prefer to see the debugger in such a case, unless the user makes
> use of #whenRejected: explicitely.

This is a good idea. How about the following:

Promise >> fulfillWith: aBlock
	self fulfillWith: aBlock passErrors: rejecters isEmpty

... and usage of `fulfillWith:` in the future-handling code as
previously proposed, meaning that the debugger will be seen exactly when
no `whenRejected:` has been sent to the Promise?

That is,

    (1 future / 0)

will make the debugger show up, but

    (1 future / 0) whenRejected: []

will not.

In both cases, the Promise will be rejected with a ZeroDivide.

> You can avoid the debugger in the case of MorphicProjects like this: [...]

Ah, excellent, thank you, that works well. Now there are no failing
tests and no expected failures in the tests in the changeset.

Tony
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FuturePromiseErrorHandling.2.cs
Type: text/x-csharp
Size: 3969 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180213/dd6e312c/attachment.bin>


More information about the Squeak-dev mailing list