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

Remove custom unhandledrejection event propagation #1716

Merged
merged 1 commit into from
May 11, 2023

Conversation

dfahlander
Copy link
Collaborator

The custom unhandledrejection event propagation is not reliable when native async function throw errors. The event is fired before we have a chance to detect that the error was indeed handled in a later tick.

User code should not rely on unhandledrejection anyway but have it as a debugging tool rather - to detect errors in the code where promises aren't caught properly. Users that use async functions will get the native unhandledrejection functionality anyway, but those who still use promise-based .then()/ .catch() might not get this warning anymore after this commit. However, I believe it's better to not warn when the warning is not correct anyway.

Related issues:

Resolves #1684

The custom unhandledrejection event propagation is not reliable when native async function throw errors. The event is fired before we have a chance to detect that the error was indeed handled in a later tick.

User code should not rely on unhandledrejection anyway but have it as a debugging tool rather - to detect errors in the code where promises aren't caught properly. Users that use async functions will get the native unhandledrejection functionality anyway, but those who still use promise-based .then()/ .catch() might not get this warning anymore after this commit. However, I believe it's better to not warn when the warning is not correct anyway.

Related issues:
* #1706
* #1689
* #934

Resolves #1684
@dfahlander dfahlander merged commit 552005d into master May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-throwing error in transaction catch block will propagate transaction error again
1 participant