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

Possibly unhandled rejection: {} #15516

Closed
EricBourland opened this issue Dec 18, 2016 · 2 comments
Closed

Possibly unhandled rejection: {} #15516

EricBourland opened this issue Dec 18, 2016 · 2 comments

Comments

@EricBourland
Copy link

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
If a promise throws an exception, a useless error is now printed to the console instead of what went wrong: Possibly unhandled rejection: {}

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
http://plnkr.co/edit/PE1GPJSDUxRGiabjACCn

What is the expected behavior?
It should print the exception that was thrown and the stack trace

What is the motivation / use case for changing the behavior?
To help track down where/why the exception was thrown

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
It worked before, now in 1.6.0 it gives this new error message that swallows the exception

Other information (e.g. stacktraces, related issues, suggestions how to fix)
It happens because ToDebugString calls JSON.Stringify on the exception, which returns {}. it needs to handle error objects differently.

@thany
Copy link

thany commented Dec 19, 2016

Yes, this desperately needs fixing. This error is utterly useless.

Every time I see this one, I have to step into the processChecks() function using the debugger, and checking the toCheck variable to see what actual error is in there. Couldn't be more irritating when I'm trying to get something done.

@gkalpak
Copy link
Member

gkalpak commented Dec 19, 2016

Closing as duplicate of #14631.

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

No branches or pull requests

3 participants