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

[Feature]Should provider a better error logger #955

Closed
JiaLiPassion opened this issue Nov 13, 2017 · 0 comments · Fixed by #959
Closed

[Feature]Should provider a better error logger #955

JiaLiPassion opened this issue Nov 13, 2017 · 0 comments · Fixed by #959

Comments

@JiaLiPassion
Copy link
Collaborator

JiaLiPassion commented Nov 13, 2017

the information is from angular/angular#19923

Regular errors, such as HTTP errors, are correctly be logged as

ERROR HttpErrorResponse
When an error occur in a resolve guard, I get a weird stack trace:

ERROR Error: Uncaught (in promise): [object Object] 
   at resolvePromise (unpkg.com/zone.js@0.8.12/dist/zone.js:770)
    at resolvePromise (unpkg.com/zone.js@0.8.12/dist/zone.js:741)
    at eval (unpkg.com/zone.js@0.8.12/dist/zone.js:818)
    at ZoneDelegate.invokeTask (unpkg.com/zone.js@0.8.12/dist/zone.js:424)
    at Object.onInvokeTask (unpkg.com/@angular/[email protected]/bundles/core.umd.js:3913)
    at ZoneDelegate.invokeTask (unpkg.com/zone.js@0.8.12/dist/zone.js:423)
    at Zone.runTask (unpkg.com/zone.js@0.8.12/dist/zone.js:191)
    at drainMicroTaskQueue (unpkg.com/zone.js@0.8.12/dist/zone.js:584)
    at XMLHttpRequest.ZoneTask.invoke (unpkg.com/zone.js@0.8.12/dist/zone.js:490)

Expected behavior

I expect the resolve error to be logged / handled as any other error, so that we can send it to our error collector (Raygun).

Minimal reproduction of the problem with instructions

Example of correct error log: https://stackblitz.com/edit/angular-5cl2hn
Example of incorrect error log: https://stackblitz.com/edit/angular-n2gxqp

Environment

Angular version: tested on both Angular 4.4.4 as Angular 5.0-RC5

Occurs on any fresh CLI generated project.

JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Nov 18, 2017
JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Dec 19, 2017
mhevery pushed a commit that referenced this issue Dec 27, 2017
…or (#959)

* feat(promise): fix #955, print readable log when uncaught promise error

* fix(promise): handle test case error in IE
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant