diff options
author | Bjørn Erik Pedersen <[email protected]> | 2018-10-03 14:58:09 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2018-10-16 22:10:56 +0200 |
commit | 35fbfb19a173b01bc881f2bbc5d104136633a7ec (patch) | |
tree | 636d0d51fa262dc808eb3c5cc9cf92ad977a0c6a /deps | |
parent | 3a3089121b852332b5744d1f566959c8cf93cef4 (diff) | |
download | hugo-35fbfb19a173b01bc881f2bbc5d104136633a7ec.tar.gz hugo-35fbfb19a173b01bc881f2bbc5d104136633a7ec.zip |
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
Diffstat (limited to 'deps')
-rw-r--r-- | deps/deps.go | 9 |
1 files changed, 2 insertions, 7 deletions
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 |