hugolib: Continue the file context/line number errors work

See #5324
This commit is contained in:
Bjørn Erik Pedersen 2018-10-21 12:20:21 +02:00
parent 7930d2132a
commit d1661b823a
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
23 changed files with 444 additions and 236 deletions

View file

@ -33,13 +33,13 @@ type templateInfo struct {
}
func (info templateInfo) errWithFileContext(what string, err error) error {
err = errors.Wrapf(err, "file %q: %s:", info.realFilename, what)
err = errors.Wrapf(err, what)
err, _ = herrors.WithFileContextForFile(
err,
info.realFilename,
info.filename,
info.fs,
"go-html-template",
herrors.SimpleLineMatcher)
return err