From 35fbfb19a173b01bc881f2bbc5d104136633a7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 3 Oct 2018 14:58:09 +0200 Subject: commands: Show server error info in browser The main item in this commit is showing of errors with a file context when running `hugo server`. This can be turned off: `hugo server --disableBrowserError` (can also be set in `config.toml`). But to get there, the error handling in Hugo needed a revision. There are some items left TODO for commits soon to follow, most notable errors in content and config files. Fixes #5284 Fixes #5290 See #5325 See #5324 --- deps/deps.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'deps') diff --git a/deps/deps.go b/deps/deps.go index 2b66a153f..1e2686421 100644 --- a/deps/deps.go +++ b/deps/deps.go @@ -16,7 +16,6 @@ import ( "github.com/gohugoio/hugo/resource" "github.com/gohugoio/hugo/source" "github.com/gohugoio/hugo/tpl" - jww "github.com/spf13/jwalterweatherman" ) // Deps holds dependencies used by many. @@ -25,7 +24,7 @@ import ( type Deps struct { // The logger to use. - Log *jww.Notepad `json:"-"` + Log *loggers.Logger `json:"-"` // Used to log errors that may repeat itself many times. DistinctErrorLog *helpers.DistinctLogger @@ -122,10 +121,6 @@ func (d *Deps) LoadResources() error { return err } - if th, ok := d.Tmpl.(tpl.TemplateHandler); ok { - th.PrintErrors() - } - return nil } @@ -256,7 +251,7 @@ func (d Deps) ForLanguage(cfg DepsCfg) (*Deps, error) { type DepsCfg struct { // The Logger to use. - Logger *jww.Notepad + Logger *loggers.Logger // The file systems to use Fs *hugofs.Fs -- cgit v1.2.3