DEV Community 👩‍💻👨‍💻

DEV Community 👩‍💻👨‍💻 is a community of 963,673 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in

Discussion on: Tracking errors in Angular with Sentry

constjs profile image
Piotr Lewandowski

You're assuming error can contain "originalError" property, I'm seeing this for first time - how such error can happen?

handleError(error) {
    error.originalError || error
n_mehlhorn profile image
Nils Mehlhorn Author • Edited on

Angular's zone might wrap occurring errors in order to have error messages point to the place where an error occurred initially. You can see this in the sources here:

I couldn't find any precise docs on that, yet it's also done like this in the Sentry official examples. Therefore I thought it's best to keep the check in there.