diff options
Diffstat (limited to 'vendor/codeberg.org/gruf/go-errors/v2/errors.go')
-rw-r--r-- | vendor/codeberg.org/gruf/go-errors/v2/errors.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/codeberg.org/gruf/go-errors/v2/errors.go b/vendor/codeberg.org/gruf/go-errors/v2/errors.go index 180fc6799..18f780994 100644 --- a/vendor/codeberg.org/gruf/go-errors/v2/errors.go +++ b/vendor/codeberg.org/gruf/go-errors/v2/errors.go @@ -24,13 +24,13 @@ func Wrapf(err error, msgf string, args ...interface{}) error { return create(fmt.Sprintf(msgf, args...), err) } -// Stacktrace fetches a stored stacktrace of callers from an error, or returns nil. +// Stacktrace fetches first stored stacktrace of callers from error chain. func Stacktrace(err error) Callers { - var callers Callers - if err, ok := err.(interface { //nolint + var e interface { Stacktrace() Callers - }); ok { - callers = err.Stacktrace() } - return callers + if !As(err, &e) { + return nil + } + return e.Stacktrace() } |