Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Add traceback to unhandled promise rejections #15522

Closed
wants to merge 2 commits into from

Conversation

graingert
Copy link
Contributor

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
Console is filled with meaningless: Possibly unhandled rejection: {} errors

What is the new behavior (if this is a feature change)?
Console is filled with juicy traceback info.

Does this PR introduce a breaking change?
I don't think so

Please check if the PR fulfills these requirements

Other information:

@graingert
Copy link
Contributor Author

graingert commented Dec 19, 2016

This could break people relying on unhandled rejections never being real exceptions. To be non-breaking we could add a $unhandledRejectionHandler service that takes a rejection, and delegates to $exceptionHandler this way I could add a handler that passes the exception directly but the default would be to strip the error and tasty tracebacks

@gkalpak
Copy link
Member

gkalpak commented Dec 19, 2016

Actually, the "juicy info" does already exist. It is just stringified into a less juicy {} (which we need to fix).
Closing as duplicate of #14631.

@gkalpak gkalpak closed this Dec 19, 2016
@graingert graingert deleted the patch-3 branch December 19, 2016 23:00
@graingert
Copy link
Contributor Author

@gkalpak stringifying the exception breaks trace-back info because angular doesn't stringify errors properly.

Angular calls Errors 'exceptions' and brutally stringifies them before they can be safely carried to the gentle, sweet, embrace of window.onerror.

@graingert
Copy link
Contributor Author

graingert commented Dec 19, 2016

@gkalpak no it doesn't.

Nobody wants angular to mess with their Errors and turn them into 'exceptions' for the $exceptionHandler

re-opened for your delectation and delight at #15527

@gkalpak
Copy link
Member

gkalpak commented Dec 19, 2016

That's what I meant by "we need to fix it". Embarrassing as it may be, I have to admit I did not realize this was a PR, until now. I thought it was an issue 😳

Sorry, for not paying attention and thx for your perseverance. I promise I'll treat #15527 rightly 😛

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

Successfully merging this pull request may close these issues.

3 participants