sentrycore: set generated exceptionType on last exception instead of the first #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Every once in a while an unhelpfully formatted error shows up in our Sentry reporting:
After digging into this because it bothers me, turns out that even though the Sentry library says "first" exception is used for the title it actually uses the last one! Sure enough, this is mentioned in the cockroach error source:
https://github.com/cockroachdb/errors/blob/26622367a22260fa287d2f7aa2a085b0324c74ee/report/report.go#L324-L325
and we see it in action in the Sentry UI, the title is the exception we don't overwrite when there are multiple:
Another example: https://sourcegraph.sentry.io/issues/4193949796/?project=6583153
The errors where the title is what we want all have only 1 generated exception.
I originally thought that maybe we should overwrite each detected exception individually with a different generated message that has been tidied up, but the Sentry exception struct is a bit weird so I figured whatever, we can revisit this next time.