Improve nilpointer error message

This commit is contained in:
Bjørn Erik Pedersen
2024-02-01 16:35:41 +01:00
parent 4174a7866b
commit 8d42a7942a
3 changed files with 35 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import (
"strings"
"sync"
"github.com/gohugoio/hugo/common/herrors"
"github.com/gohugoio/hugo/hugolib/doctree"
"github.com/gohugoio/hugo/config"
@@ -110,7 +111,7 @@ func (s *Site) renderPages(ctx *siteRenderContext) error {
err := <-errs
if err != nil {
return fmt.Errorf("failed to render pages: %w", err)
return fmt.Errorf("failed to render pages: %w", herrors.ImproveIfNilPointer(err))
}
return nil
}