Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

feat ExistStack: Add a public method to determine if the error has been appended to the stack. #239

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat func ExistStack(err error) bool:
non-intrusive:
Add a public method to determine if the error has been appended to the stack.
Avoid adding the stack repeatedly for errors.
  • Loading branch information
wbflooksky authored May 19, 2021
commit b3e14fafbaa846b3accea2fd58f36f80d65f4ffb
7 changes: 4 additions & 3 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@
//
// 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
}
//
// type stackTracer interface {
// StackTrace() errors.StackTrace
// }
//
// The returned errors.StackTrace type is defined as
//
Expand Down