mirror of https://github.com/containers/image.git
Improve an error message
We are seeing > reference "[overlay@...]quay.io/...@sha256:..." does not resolve to an image ID: identifier is not an image which is misleading; hide the ErrNoSuchImage text. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
b706d9353c
commit
175ffae56f
|
|
@ -153,7 +153,9 @@ func (s *storageReference) resolveImage(sys *types.SystemContext) (*storage.Imag
|
|||
}
|
||||
if s.id == "" {
|
||||
logrus.Debugf("reference %q does not resolve to an image ID", s.StringWithinTransport())
|
||||
return nil, fmt.Errorf("reference %q does not resolve to an image ID: %w", s.StringWithinTransport(), ErrNoSuchImage)
|
||||
// %.0w makes the error visible to error.Unwrap() without including any text.
|
||||
// ErrNoSuchImage ultimately is “identifier is not an image”, which is not helpful for identifying the root cause.
|
||||
return nil, fmt.Errorf("reference %q does not resolve to an image ID%.0w", s.StringWithinTransport(), ErrNoSuchImage)
|
||||
}
|
||||
if loadedImage == nil {
|
||||
img, err := s.transport.store.Image(s.id)
|
||||
|
|
|
|||
Loading…
Reference in New Issue