Decide whether catch handler should be wired with the semantic of promise.then().catch() or promise.catch()
At
|
if ("catch" in thenReturn) { |
the catch handler for an Unpromise is wired to the
catch() returned by
then() rather than wiring directly to
this.promise.catch()
This is harmless given the then handler chained beforehand (which is synchronous and guaranteed to execute without error) but I recall this was a deliberate design decision from the semantics of promises, but would be good to articulate the reason, or reconsider the choice.
Decide whether catch handler should be wired with the semantic of
promise.then().catch()orpromise.catch()At
watchable/packages/unpromise/src/unpromise.ts
Line 108 in bb7131e
catch()returned bythen()rather than wiring directly tothis.promise.catch()This is harmless given the then handler chained beforehand (which is synchronous and guaranteed to execute without error) but I recall this was a deliberate design decision from the semantics of promises, but would be good to articulate the reason, or reconsider the choice.