mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
resource: Improve error processing error message
This commit is contained in:
parent
4edb4bcc65
commit
53dac9a506
1 changed files with 5 additions and 2 deletions
|
@ -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 {
|
||||||
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue