Skip to content

How to capture errors outside Angular context in zoneless? #56240

@eneajaho

Description

@eneajaho

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

When working with zone.js we can easily capture errors (inside and outside Angular context) in the ErrorHandler using a CustomErrorHandler. When going zoneless we can no longer get both kinds of thrown errors.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-ggzajl?file=src%2Fmain.ts

Please provide the exception or error you saw

When we have zoneless we can listen only to errors thrown in Angular context. 
When we have zone enabled we can listen to all errors.

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

This is probably correct behavior, but is there any way to get these errors through the custom error handler?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimecore: error handlingcore: zonelessIssues related to running Angular without zone.js

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions