diff --git a/distribution/errors.go b/distribution/errors.go index b7d03088f7..91470eafe4 100644 --- a/distribution/errors.go +++ b/distribution/errors.go @@ -32,13 +32,17 @@ type fallbackError struct { // Error renders the FallbackError as a string. func (f fallbackError) Error() string { - return f.Cause().Error() + return f.err.Error() } func (f fallbackError) Cause() error { return f.err } +func (f fallbackError) Unwrap() error { + return f.err +} + type notFoundError struct { cause errcode.Error ref reference.Named @@ -64,6 +68,10 @@ func (e notFoundError) Cause() error { return e.cause } +func (e notFoundError) Unwrap() error { + return e.cause +} + // unsupportedMediaTypeError is an error issued when attempted // to pull unsupported content. type unsupportedMediaTypeError struct {