Skip to content

ignoreErrors ignores the wrong linked error #8079

Closed
@lobsterkatie

Description

@lobsterkatie

In cases where there are linked errors, the event.exception.values array contains the errors in chronological order: first the cause error and then the main error:

image

and indeed, this is how they come through in the resulting JSON:

image

But in the UI, the order is reversed:

image

Also, it is the second error which shows up as the title:

image

This suggests that we should be filtering on the second error, since everything in the UI points to it being the "main" one. But for ignoreErrors, when we're getting the strings to compare against the ignored values, we take the first error, not the second:

const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {};

Two options for fixing this:

  1. Take the last error instead of the first error. For any event with only one (which is most of them), the first and the last are the same, so nothing would change. For events with multiple errors, we'd be filtering on the right one, albeit a different one than we've been filtering on.
  2. Check all of the errors in event.exception.values. This has the advantage of being backwards compatible (errors which are currently being ignored will continue to be ignored), but might be less intuitive behavior.

I'm happy to make a PR for either solution. Which do y'all think is best?

(For context, this is coming up because we're trying to be better dogfooders of the SDK in the Sentry FE, and go through the process of de-noising our JS project. In order to do that, it'd be nice to be able to use ignoreErrors, but it doesn't currently filter in the way we need (and in the way, IMHO, it should).)

Metadata

Metadata

Assignees

Labels

Package: coreIssues related to the Sentry Core SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions