Skip to content

Grouping differences due to reporting suppressed exceptions #4054

@adinauer

Description

@adinauer

Integration

sentry

Java Version

Version

8

Steps to Reproduce

There is changes in grouping in v8 of the Java SDK due to now reporting suppressed exceptions and Sentry backend sometimes marking the suppressed exception as the main one.

While it might be preferred by some users to have the suppressed exception as main one, we want to fix the inconsistency first and maybe later discuss what the main exception should be.

When capturing an exception without a root cause, the suppressed exception (ArithmeticException) is used as main exception instead of the one we'd expect (RuntimeException).

RuntimeException heyThereMainException = new RuntimeException("hey there main exception without root cause");
heyThereMainException.addSuppressed(new ArithmeticException("suppressed exception no rootcause"));

Sentry.captureException(heyThereMainException);

When capturing an exception that has a root cause and a suppressed exception it uses the expected main exception (RuntimeException).

IllegalArgumentException rootCause = new IllegalArgumentException("root cause");
RuntimeException heyThereMainException = new RuntimeException("hey there main exception", rootCause);
heyThereMainException.addSuppressed(new ArithmeticException("suppressed exception"));

Sentry.captureException(heyThereMainException);

More details on this internal link.

Expected Result

Sentry choses the same exception as main exception, regardless of that exception having a cause attached to it or not. It should use RuntimeException as main exception in both examples above.

Actual Result

The suppressed exception (ArithmeticException) is used as main one.

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions