diff options
Diffstat (limited to 'hugolib/page.go')
-rw-r--r-- | hugolib/page.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index fb3b597be..af3deb59f 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -629,9 +629,12 @@ func (p *pageState) Render(layout ...string) (template.HTML, error) { } -// wrapError adds some more context to the given error if possible +// wrapError adds some more context to the given error if possible/needed func (p *pageState) wrapError(err error) error { - + if _, ok := err.(*herrors.ErrorWithFileContext); ok { + // Preserve the first file context. + return err + } var filename string if !p.File().IsZero() { filename = p.File().Filename() |