DEV Community


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

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.