Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With chained errors, which one counts as the main one? #64088

Open
Tracked by #1859
lobsterkatie opened this issue Jan 29, 2024 · 3 comments
Open
Tracked by #1859

With chained errors, which one counts as the main one? #64088

lobsterkatie opened this issue Jan 29, 2024 · 3 comments

Comments

@lobsterkatie
Copy link
Member

lobsterkatie commented Jan 29, 2024

There have been a number of issues which have come up lately having to do with which one of a chained set of errors we use for the purposes of grouping, titling an issue, calculating stack.module, etc. In many cases, what we're doing is the opposite of what the user expects, i.e., we're picking the wrong error to use. Here are a few examples:

To solve this we need to:

  • Decide for sure which error in a chain it makes sense to use. It's possible this may differ by platform, but within a platform, we should be consistent everywhere across the product. In addition to the top-of-the-chain/bottom-of-the-chain question, we also might want to consider the in-app-i-ness of the frames in each error's stacktrace.
  • Find all the places where we handle chained errors and have to make that determination. In some instances, the choice will be based on the value of main_exception_id, which is calculated based on an is_exception_group value sent by the SDK. (See here for details.) There may be other places where we determine that, too, though (if we're hardcoding to always look at the top error or the bottom error, for example), so we should make sure to find those as well.
  • Where we're making the wrong choice (according to our agreement in step 1), update the code and/or get the SDK to send a different main_exception_id value.

Semi-related: In some cases we may want to reverse the order of the linked errors before we decide which one to use. (In those cases, we'd do this rather than just make a different choice because the order affects things like how the chain of errors is displayed in the UI.) See #64087.

@lobsterkatie
Copy link
Member Author

Just wanted to highlight part of @markushi's comment on getsentry/sentry-java#3184, as I think it's an interesting idea to consider vis-à-vis titling. (The whole thread there is relevant and worth reading, but didn't want to lose track of this idea in particular.)

Are the error message and stacktrace of the wrapper error always the same and/or do they provide any informational value?

Whilst the wrapped exception itself and it's stacktrace don't provide any extra information, it indicates one crucial semantic information: An app crash is about to happen.

Thinking more about future solutions: I'm wondering if in situations where the wrapping exception contains no in-app frames, we simply could decide to just use the inner exception for titleing.

@lobsterkatie
Copy link
Member Author

More discussion of the above: #62299 (comment)

@armenzg
Copy link
Member

armenzg commented Jun 13, 2024

An example of picking the title from the cause error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants