resource: Improve error processing error message

This commit is contained in:
Bjørn Erik Pedersen 2018-02-13 09:14:44 +01:00
parent 08521dac83
commit 2851af0225
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -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()