From b8a2818e70e402118f2a85c7bcea66a74f16b41d Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Tue, 4 Feb 2020 14:21:59 +0100 Subject: Wrap error for failing ImageSize calls Signed-off-by: Sascha Grunert --- libpod/image/image.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libpod/image/image.go b/libpod/image/image.go index 355249b12..ba1080a71 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -709,11 +709,12 @@ func (i *Image) Size(ctx context.Context) (*uint64, error) { } i.image = localImage } - if sum, err := i.imageruntime.store.ImageSize(i.ID()); err == nil && sum >= 0 { + sum, err := i.imageruntime.store.ImageSize(i.ID()) + if err == nil && sum >= 0 { usum := uint64(sum) return &usum, nil } - return nil, errors.Errorf("unable to determine size") + return nil, errors.Wrap(err, "unable to determine size") } // toImageRef returns an Image Reference type from an image -- cgit v1.2.3-54-g00ecf