Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Remove reliance on pkg/errors #228

Merged
merged 2 commits into from
Jan 25, 2019
Merged

Remove reliance on pkg/errors #228

merged 2 commits into from
Jan 25, 2019

Conversation

mattrobenolt
Copy link
Contributor

We don't actually use anything out of this library except talking with
it's interfaces, so let's abstract out usage rather than forcing a
strong dependency on the library.

We don't actually use anything out of this library except talking with
it's interfaces, so let's abstract out usage rather than forcing a
strong dependency on the library.
}
return &Stacktrace{Frames: frames}
} else {
type stackTracer interface {
Copy link
Member

Choose a reason for hiding this comment

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

this is when i remember i dont know go well enough to understand what this is for

return &Stacktrace{Frames: frames}
} else {
type stackTracer interface {
StackTrace() []runtime.Frame

Choose a reason for hiding this comment

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

In respect of /pkg/errors this implementation does not work. Not yet sure if I'm doing something wrong, but passing error created by errors.New(...) to this function, ends up in !ok if statement. This is because pkg/errors says:

// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are
// invoked. This information can be retrieved with the following interface:
//
//     type stackTracer interface {
//             StackTrace() errors.StackTrace
//     }
//
// The returned errors.StackTrace type is defined as
//
//     type StackTrace []Frame

How should I use this method with /pkg/errors ? Im confused.

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.

4 participants