resource: Include the transformation step in the error message
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 11 Jul 2018 09:03:15 +0000 (11:03 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 11 Jul 2018 09:03:15 +0000 (11:03 +0200)
Fixes #4924

resource/transform.go

index 4b6663d0ccdffc21bc7688adac97de123a350fed..fcb1014380b334933d66e9fa2e38b8c2b8c27317 100644 (file)
@@ -17,6 +17,7 @@ import (
        "bytes"
        "path"
        "strconv"
+       "strings"
 
        "github.com/gohugoio/hugo/common/errors"
        "github.com/gohugoio/hugo/helpers"
@@ -389,7 +390,7 @@ func (r *transformedResource) transform(setContent bool) (err error) {
                                // If a prepared bundle for this transformation chain is available, use that.
                                f := r.tryTransformedFileCache(key)
                                if f == nil {
-                                       return fmt.Errorf("failed to transform %q (%s): %s", tctx.InPath, tctx.InMediaType.Type(), err)
+                                       return fmt.Errorf("%s: failed to transform %q (%s): %s", strings.ToUpper(tr.transformation.Key().name), tctx.InPath, tctx.InMediaType.Type(), err)
                                }
                                transformedContentr = f
                                defer f.Close()