Improve error handling/messages in Hugo Pipes

Fixes #14257
Closes #14270
This commit is contained in:
Bjørn Erik Pedersen
2025-12-16 16:25:37 +01:00
parent b82e496c13
commit 0bf61353f6
15 changed files with 212 additions and 97 deletions
@@ -17,6 +17,7 @@ import (
"strings"
"testing"
qt "github.com/frankban/quicktest"
"github.com/gohugoio/hugo/hugolib"
)
@@ -118,8 +119,9 @@ CONTENT
files = strings.ReplaceAll(files, `2`, `"x"`)
b, _ = hugolib.TestE(t, files)
b.AssertLogMatches(`error calling ToHTML: startLevel: unable to cast "x" of type string`)
b, err := hugolib.TestE(t, files)
b.Assert(err, qt.Not(qt.IsNil))
b.Assert(err.Error(), qt.Contains, `error calling ToHTML: startLevel: unable to cast "x" of type string`)
}
func TestHeadingsNilpointerIssue11843(t *testing.T) {