Skip to content
This repository has been 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
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek commented Mar 7, 2019

Closes #227
Closes #137
Fixes #228


// 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 {

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?

Copy link
Contributor Author

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

2 participants