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

Ability to set unhandled_rejection callback #20

Open
sheerun opened this issue Oct 4, 2016 · 1 comment
Open

Ability to set unhandled_rejection callback #20

sheerun opened this issue Oct 4, 2016 · 1 comment

Comments

@sheerun
Copy link
Contributor

sheerun commented Oct 4, 2016

Hey!

Your library is awesome, but the promises in my code get often rejected and I don't even know about it.. Could you provide Promise.unhandled_rejection function to handle unhandled rejections (I'd use it in development only)

@dylanahsmith
Copy link
Collaborator

How would you define an unhandled rejection? Since a promise could be rejected before any callbacks are added to it, then it seems like we can only be sure that a promise is unhandled once it is being garbage collected (i.e. using ObjectSpace.define_finalizer).

Did you have any ideas of how this could be implemented? Could this be implemented in a class that derives from Promise to prototype the idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants