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

[Feature]Should provider a better error logger #955

Description

@JiaLiPassion

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/core@4.3.6/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions