Permalink
Browse files

resource: Improve error processing error message

  • Loading branch information...
bep committed Feb 13, 2018
1 parent 4edb4bc commit 53dac9a5067dfd84283a2b2d837738a63b63b596
Showing with 5 additions and 2 deletions.
  1. +5 −2 resource/image.go
View
@@ -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()

0 comments on commit 53dac9a

Please sign in to comment.