Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch wiring semantics #89

Open
cefn opened this issue Sep 30, 2024 · 0 comments
Open

Catch wiring semantics #89

cefn opened this issue Sep 30, 2024 · 0 comments
Labels
unpromise Related to @watchable/unpromise

Comments

@cefn
Copy link
Owner

cefn commented Sep 30, 2024

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.

@cefn cefn added the unpromise Related to @watchable/unpromise label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unpromise Related to @watchable/unpromise
Projects
None yet
Development

No branches or pull requests

1 participant