summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-errors/v2/errors.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-01-17 11:25:13 +0000
committerLibravatar GitHub <noreply@github.com>2023-01-17 11:25:13 +0000
commita6c6bdb34ab668ab810308e63325a891e404e434 (patch)
tree12be85a203123dbaa602e8173343c015d5149047 /vendor/codeberg.org/gruf/go-errors/v2/errors.go
parent[bugfix] Parse video metadata more accurately; allow Range in fileserver (#1342) (diff)
downloadgotosocial-a6c6bdb34ab668ab810308e63325a891e404e434.tar.xz
[chore]: Bump codeberg.org/gruf/go-errors/v2 from 2.0.2 to 2.1.1 (#1346)
Bumps codeberg.org/gruf/go-errors/v2 from 2.0.2 to 2.1.1. --- updated-dependencies: - dependency-name: codeberg.org/gruf/go-errors/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/codeberg.org/gruf/go-errors/v2/errors.go')
-rw-r--r--vendor/codeberg.org/gruf/go-errors/v2/errors.go12
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()
}