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

Emit unhandled rejection events in Node #70

Open
benjamingr opened this issue Jan 8, 2015 · 11 comments
Open

Emit unhandled rejection events in Node #70

benjamingr opened this issue Jan 8, 2015 · 11 comments

Comments

@benjamingr
Copy link

Hey, I've written the following proposal here: https://gist.github.com/benjamingr/0237932cee84712951a2

I'd love your feedback.

@ForbesLindesay
Copy link
Member

I have no particular objection to this. I would suggest submitting a pull request to add this spec as the readme for https://github.com/promises-aplus/unhandled-rejections-spec so it can be discussed by the Promises A+ community. If it is accepted there, I will definitely implement it.

@benjamingr
Copy link
Author

Bluebird added this and RSVP and es6promise are adding this soon. iojs said they're interested in the idea and are positively considering it.

I don't think this belongs to the spec since it's a node-only feature.

@benjamingr
Copy link
Author

Updating that io.js pull request has been made - this will likely land in the next version and is being discussed in the TC meeting for approval.

@benjamingr
Copy link
Author

Now in io.js, please consider adding it for compatibility.

@johnhaley81
Copy link

👍 to this

@jtfairbank
Copy link

+1, no errors are thrown in node which makes debugging super hard

@benjamingr
Copy link
Author

Now in Q, you guys and RSVP are the only ones left - you can see the Q PR this is not a lot of code to add and it solves a problem for many users - please consider.

@benjamingr
Copy link
Author

Now in native promises, this is now a divergence from the native NodeJS behavior.

@art-in
Copy link

art-in commented Oct 11, 2015

for those who stuck to catch unhandled rejections with then/promise.
Take a look at non standard .done() method. Maybe it will save you as it saved me..

promise
    .then(function() {
        throw 'BOOM'
    })
    .done() // exception thrown outside

@benjamingr
Copy link
Author

Or use one of the libraries that implements this.

@benjamingr
Copy link
Author

@ForbesLindesay ping, both browsers and Node emit these events now for a while. The adjustments to the ES spec has even been done tc39/ecma262#76

Any chance this will work in then/promise?

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

6 participants