mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
tpl/data: Revise error handling in getJSON and getCSV
The most important part being: Log ERROR, but do not stop the build on remote errors. Fixes #5076
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/common/loggers"
|
||||
"github.com/gohugoio/hugo/config"
|
||||
"github.com/gohugoio/hugo/deps"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
@@ -171,10 +172,15 @@ func newDeps(cfg config.Provider) *deps.Deps {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
logger := loggers.NewErrorLogger()
|
||||
|
||||
return &deps.Deps{
|
||||
Cfg: cfg,
|
||||
Fs: hugofs.NewMem(l),
|
||||
ContentSpec: cs,
|
||||
Cfg: cfg,
|
||||
Fs: hugofs.NewMem(l),
|
||||
ContentSpec: cs,
|
||||
Log: logger,
|
||||
DistinctErrorLog: helpers.NewDistinctLogger(logger.ERROR),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user