-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Browser rejection hook #106
Comments
Awaiting proposals how do it w/o breaking current default behavior and adding |
The problem is that it's a lot of code to run these browser events in old browsers. I think even just adding a window.onpossiblyunhandledrejection and not guaranteeing it will stay around is immensely useful. |
You mean simple if(isNode){
process.emit('unhandledRejection', reason, promise);
} else if(global.onunhandledrejection){
global.onunhandledrejection({promise: promise, reason: reason});
} else if(global.console && console.error){
console.error('Unhandled promise rejection', reason);
} ? |
That would work and definitely aid a ton of people in debugging. The main use case is that we have to include a bigger library (like bluebird) if we want any form of reporting of client side errors - which are useful in order to track errors users get so we can fix them. |
Ok, I will add it. Warning: The problem here - we can't add it to native |
Hey, it would be great for us if you exposed the
process
unhandledRejection
hook event somehow to browsers, this is useful for logging errors and handling problems.Alternatively, if you make the
isNode
check overridable.The text was updated successfully, but these errors were encountered: