Added sentry hint with the original errs#37
Open
ReallyLiri wants to merge 5 commits intoTheZeroSlave:masterfrom
Open
Added sentry hint with the original errs#37ReallyLiri wants to merge 5 commits intoTheZeroSlave:masterfrom
ReallyLiri wants to merge 5 commits intoTheZeroSlave:masterfrom
Conversation
Owner
|
@ReallyLiri hi, thnx for PR) |
costela
reviewed
Jul 20, 2023
| ) []sentry.Exception { | ||
| for i := 0; i < maxErrorDepth && err != nil; i++ { | ||
| wrappedErr := err | ||
| err = errors.Cause(err) |
Contributor
There was a problem hiding this comment.
alternatively, why not keep the select logic below, and just keep track of a - possibly nil - previousErr, initialized outside the loop?
this way we need mentally less "special-casing" of this specific lib.
Comment on lines
+201
to
+202
| if strings.HasSuffix(exception.Type, "errors.fundamental") { | ||
| // err was created with `errors.New(msg)` - make `msg` the type, |
Contributor
There was a problem hiding this comment.
I actually see *errors.errString here (see https://goplay.tools/snippet/txizx5D1JSQ).
Is the comment maybe not up-to-date? Or the check?
Also, this type doesn't seem to have ever been renamed since its introduction 12 years ago, but it may still be a bit brittle to check directly against it. Maybe it would be enough to check for any error type inside of errors?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is very helpful in
BeforeSend, to have the actual originalerrorstructs to be able for example to filter outnet.Errorinstances