From 2851af0225cdf6c4e47058979cd22949ed6d1fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 13 Feb 2018 09:14:44 +0100 Subject: [PATCH] resource: Improve error processing error message --- resource/image.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resource/image.go b/resource/image.go index c9ee90bf1..1914b3c04 100644 --- a/resource/image.go +++ b/resource/image.go @@ -223,11 +223,14 @@ func (i *Image) doWithImageConfig(action, spec string, f func(src image.Image, c return i.spec.imageCache.getOrCreate(i, key, func(resourceCacheFilename string) (*Image, error) { ci := i.clone() + errOp := action + errPath := i.AbsSourceFilename() + ci.setBasePath(conf) src, err := i.decodeSource() if err != nil { - return nil, err + return nil, &os.PathError{Op: errOp, Path: errPath, Err: err} } if conf.Rotate != 0 { @@ -237,7 +240,7 @@ func (i *Image) doWithImageConfig(action, spec string, f func(src image.Image, c converted, err := f(src, conf) if err != nil { - return ci, err + return ci, &os.PathError{Op: errOp, Path: errPath, Err: err} } b := converted.Bounds()