aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/pkg/errors/errors.go
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2020-01-23 08:38:26 +0000
committerMatthew Heon <mheon@redhat.com>2020-01-23 04:35:39 -0500
commit88e340c451bcbbe2ee64863366f408e58edd5ac0 (patch)
treebfa396539c7189e5119a41b89297d90ec2947885 /vendor/github.com/pkg/errors/errors.go
parentac3a6b80b0ccd2f9592110811ccf6fd844110b9e (diff)
downloadpodman-88e340c451bcbbe2ee64863366f408e58edd5ac0.tar.gz
podman-88e340c451bcbbe2ee64863366f408e58edd5ac0.tar.bz2
podman-88e340c451bcbbe2ee64863366f408e58edd5ac0.zip
build(deps): bump github.com/pkg/errors from 0.9.0 to 0.9.1
Bumps [github.com/pkg/errors](https://github.com/pkg/errors) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/pkg/errors/releases) - [Commits](https://github.com/pkg/errors/compare/v0.9.0...v0.9.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'vendor/github.com/pkg/errors/errors.go')
-rw-r--r--vendor/github.com/pkg/errors/errors.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go
index a9840ecee..161aea258 100644
--- a/vendor/github.com/pkg/errors/errors.go
+++ b/vendor/github.com/pkg/errors/errors.go
@@ -260,3 +260,29 @@ func (w *withMessage) Format(s fmt.State, verb rune) {
io.WriteString(s, w.Error())
}
}
+
+// Cause returns the underlying cause of the error, if possible.
+// An error value has a cause if it implements the following
+// interface:
+//
+// type causer interface {
+// Cause() error
+// }
+//
+// If the error does not implement Cause, the original error will
+// be returned. If the error is nil, nil will be returned without further
+// investigation.
+func Cause(err error) error {
+ type causer interface {
+ Cause() error
+ }
+
+ for err != nil {
+ cause, ok := err.(causer)
+ if !ok {
+ break
+ }
+ err = cause.Cause()
+ }
+ return err
+}