diff --git a/errors.go b/errors.go index 161aea2..0fdde06 100644 --- a/errors.go +++ b/errors.go @@ -160,7 +160,13 @@ type withStack struct { func (w *withStack) Cause() error { return w.error } // Unwrap provides compatibility for Go 1.13 error chains. -func (w *withStack) Unwrap() error { return w.error } +func (w *withStack) Unwrap() error { + if e, ok := w.error.(interface{ Unwrap() error }); ok { + return e.Unwrap() + } + + return w.error +} func (w *withStack) Format(s fmt.State, verb rune) { switch verb {