This repository was archived by the owner on Aug 30, 2023. It is now read-only.
feat: Support multiple errors packages and fix Go 1.12 tests#242
Open
kamilogorek wants to merge 4 commits intomasterfrom
Open
feat: Support multiple errors packages and fix Go 1.12 tests#242kamilogorek wants to merge 4 commits intomasterfrom
kamilogorek wants to merge 4 commits intomasterfrom
Conversation
14871b2 to
7bb061f
Compare
gregwebs
reviewed
Mar 12, 2019
|
|
||
| // GetOrNewStacktrace tries to get stacktrace from err as an interface of github.com/pkg/errors, or else NewStacktrace() | ||
| // Use of reflection allows us to not have a hard dependency on any given package, so we don't have to import it | ||
| func GetOrNewStacktrace(err error, skip int, context int, appPackagePrefixes []string) *Stacktrace { |
There was a problem hiding this comment.
This is amazing! Is it possible though to have the Client have a configurable GetStackTrace method so that anyone can pas in the error implementation?
Contributor
Author
There was a problem hiding this comment.
I want to make it happen in the sentry-go
gregwebs
reviewed
Mar 12, 2019
| // Use of reflection allows us to not have a hard dependency on any given package, so we don't have to import it | ||
| func GetOrNewStacktrace(err error, skip int, context int, appPackagePrefixes []string) *Stacktrace { | ||
| // https://github.com/pkg/errors | ||
| // https://github.com/pingcap/errors |
There was a problem hiding this comment.
pingcap/errors provides GetStackTracer as the preferred way to get a StackTrace because it will recur through the error chain to find a StackTrace.
Contributor
Author
There was a problem hiding this comment.
https://github.com/getsentry/sentry-go/blob/ea5485ee7a1b900ee6e48e861a98c1346a03be4e/stacktrace.go#L75-L89 and #246
Thanks for the tip! :)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #227
Closes #137
Fixes #228