aboutsummaryrefslogtreecommitdiffhomepage
path: root/deps/deps.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-03-10 18:12:11 +0100
committerBjørn Erik Pedersen <[email protected]>2020-03-11 14:13:03 +0100
commitdf298558a5a5b747288d9656402af85e0ac75a43 (patch)
treeed62ce971aeead7cf1833a8e9310dd69cbaa565f /deps/deps.go
parentb1106f8715cac3544b8ea662b969336fe56fa047 (diff)
downloadhugo-df298558a5a5b747288d9656402af85e0ac75a43.tar.gz
hugo-df298558a5a5b747288d9656402af85e0ac75a43.zip
Improve Tailwind/PostCSS error messages
Fixes #7041 Fixes #7042
Diffstat (limited to 'deps/deps.go')
-rw-r--r--deps/deps.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/deps/deps.go b/deps/deps.go
index 49b056a7f..e482b2df7 100644
--- a/deps/deps.go
+++ b/deps/deps.go
@@ -235,7 +235,9 @@ func New(cfg DepsCfg) (*Deps, error) {
return nil, errors.WithMessage(err, "failed to create file caches from configuration")
}
- resourceSpec, err := resources.NewSpec(ps, fileCaches, logger, cfg.OutputFormats, cfg.MediaTypes)
+ errorHandler := &globalErrHandler{}
+
+ resourceSpec, err := resources.NewSpec(ps, fileCaches, logger, errorHandler, cfg.OutputFormats, cfg.MediaTypes)
if err != nil {
return nil, err
}
@@ -275,7 +277,7 @@ func New(cfg DepsCfg) (*Deps, error) {
BuildStartListeners: &Listeners{},
BuildFlags: &BuildFlags{},
Timeout: time.Duration(timeoutms) * time.Millisecond,
- globalErrHandler: &globalErrHandler{},
+ globalErrHandler: errorHandler,
}
if cfg.Cfg.GetBool("templateMetrics") {
@@ -306,7 +308,7 @@ func (d Deps) ForLanguage(cfg DepsCfg, onCreated func(d *Deps) error) (*Deps, er
// The resource cache is global so reuse.
// TODO(bep) clean up these inits.
resourceCache := d.ResourceSpec.ResourceCache
- d.ResourceSpec, err = resources.NewSpec(d.PathSpec, d.ResourceSpec.FileCaches, d.Log, cfg.OutputFormats, cfg.MediaTypes)
+ d.ResourceSpec, err = resources.NewSpec(d.PathSpec, d.ResourceSpec.FileCaches, d.Log, d.globalErrHandler, cfg.OutputFormats, cfg.MediaTypes)
if err != nil {
return nil, err
}