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

Provide unhandled rejection detection #16

Open
benjamingr opened this issue Apr 27, 2015 · 3 comments
Open

Provide unhandled rejection detection #16

benjamingr opened this issue Apr 27, 2015 · 3 comments

Comments

@benjamingr
Copy link

Cross post of Automattic/mongoose#2918

Hi, most promise libraries (Bluebird, When, Q, Native promises in io.js and so on) support unhandled rejection detection which greatly simplifies dealing with errors in promises. Other libraries (RSVP, native promises in node.js) plan to add this feature.

Here is the proposal as currently implemented in most major libraries.

It could be great if Mongoose promises supported these hooks - I'd love to help with implementation guidance if you'd like it.

@benjamingr
Copy link
Author

Anyone?

@Doweig
Copy link

Doweig commented Aug 12, 2015

@benjamingr
require('mongoose/lib/promise').prototype.error = console.error;
Will do the trick.

@refack
Copy link
Collaborator

refack commented Aug 15, 2015

👍
Ohh, wait, that's my job...
On it.
@benjamingr if you're still interested in helping the place to tigger the hooks is https://github.com/aheckmann/mpromise/blob/master/lib/promise.js#L108
Should add a few tests as well.

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

No branches or pull requests

3 participants