-
-
Notifications
You must be signed in to change notification settings - Fork 148
feat: Support multiple errors packages and fix Go 1.12 tests #242
base: master
Are you sure you want to change the base?
Conversation
14871b2
to
7bb061f
Compare
|
||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to make it happen in the sentry-go
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pingcap/errors provides GetStackTracer
as the preferred way to get a StackTrace because it will recur through the error chain to find a StackTrace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/getsentry/sentry-go/blob/ea5485ee7a1b900ee6e48e861a98c1346a03be4e/stacktrace.go#L75-L89 and #246
Thanks for the tip! :)
Closes #227
Closes #137
Fixes #228