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

Track and allow printing of unhandled rejections #6

Open
domenic opened this issue Dec 11, 2012 · 1 comment
Open

Track and allow printing of unhandled rejections #6

domenic opened this issue Dec 11, 2012 · 1 comment
Labels

Comments

@domenic
Copy link
Member

domenic commented Dec 11, 2012

The idea here would be, whenever an unhandled rejection occurs, add it to some array (or perhaps WeakMap). If it gets handled later, remove it from that array.

Then, allow printing of the unhandled rejection list. Either add is as a property to the library, or to a global environment (cf #2), or print it automatically on program exit/window onload, or print it periodically and automatically in debug mode, or...

This seems unlikely to solve the problem by itself. It's not a great experience to debug for hours before thinking to check the magic unhandled rejection list. Tooling could help, but then we're back at #2.

@MicahZoltu
Copy link

👍 I know I am over 2 years late to the party, but I figured I would offer my 2 cents.

The problem I see with any proposal that has immediate consequences for unhandled rejection is that it discourages the use of promises as first class objects. This proposal makes it so you can pass around rejected promises without being slammed with errors by your tools or crashing your app, At the same time, your tools can give you insight into the state of your unhandled rejections at an appropriate time. For example, when you break in a debugger it could immediately show you all unhandled rejections.

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

No branches or pull requests

2 participants