tpl: Improve the Execute panic error message

See #5327
This commit is contained in:
Bjørn Erik Pedersen
2018-10-17 08:24:45 +02:00
parent 1f42e47e47
commit 0fe4ff1875
2 changed files with 24 additions and 5 deletions

View File

@@ -109,6 +109,18 @@ func TestSiteBuildErrors(t *testing.T) {
a.assertLineNumber(2, err)
},
},*/
{
name: "Panic in template Execute",
fileType: single,
fileFixer: func(content string) string {
return strings.Replace(content, ".Title", ".Parent.Parent.Parent", 1)
},
assertBuildError: func(a testSiteBuildErrorAsserter, err error) {
assert.Error(err)
assert.Contains(err.Error(), "layouts/_default/single.html")
},
},
}
for _, test := range tests {