MCPcopy
hub / github.com/pkg/errors / WithStack

Function WithStack

errors.go:145–153  ·  view source on GitHub ↗

WithStack annotates err with a stack trace at the point WithStack was called. If err is nil, WithStack returns nil.

(err error)

Source from the content-addressed store, hash-verified

143// WithStack annotates err with a stack trace at the point WithStack was called.
144// If err is nil, WithStack returns nil.
145func WithStack(err error) error {
146 if err == nil {
147 return nil
148 }
149 return &withStack{
150 err,
151 callers(),
152 }
153}
154
155type withStack struct {
156 error

Callers 10

TestFormatWithStackFunction · 0.85
TestFormatWithMessageFunction · 0.85
TestFormatGenericFunction · 0.85
TestCauseFunction · 0.85
TestWithStackNilFunction · 0.85
TestWithStackFunction · 0.85
TestErrorEqualityFunction · 0.85
TestIsFunction · 0.85
TestAsFunction · 0.85
TestUnwrapFunction · 0.85

Calls 1

callersFunction · 0.85

Tested by 10

TestFormatWithStackFunction · 0.68
TestFormatWithMessageFunction · 0.68
TestFormatGenericFunction · 0.68
TestCauseFunction · 0.68
TestWithStackNilFunction · 0.68
TestWithStackFunction · 0.68
TestErrorEqualityFunction · 0.68
TestIsFunction · 0.68
TestAsFunction · 0.68
TestUnwrapFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…