Skip to content

Commit

Permalink
resource: Improve error processing error message
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Feb 15, 2018
1 parent 08521da commit 2851af0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions resource/image.go
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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) { return i.spec.imageCache.getOrCreate(i, key, func(resourceCacheFilename string) (*Image, error) {
ci := i.clone() ci := i.clone()


errOp := action
errPath := i.AbsSourceFilename()

ci.setBasePath(conf) ci.setBasePath(conf)


src, err := i.decodeSource() src, err := i.decodeSource()
if err != nil { if err != nil {
return nil, err return nil, &os.PathError{Op: errOp, Path: errPath, Err: err}
} }


if conf.Rotate != 0 { if conf.Rotate != 0 {
Expand All @@ -237,7 +240,7 @@ func (i *Image) doWithImageConfig(action, spec string, f func(src image.Image, c


converted, err := f(src, conf) converted, err := f(src, conf)
if err != nil { if err != nil {
return ci, err return ci, &os.PathError{Op: errOp, Path: errPath, Err: err}
} }


b := converted.Bounds() b := converted.Bounds()
Expand Down

0 comments on commit 2851af0

Please sign in to comment.