mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
hugolib: Improve error and reload handling of hook templates in server mode
Fixes #6635
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user