Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-10-03 15:58:09 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-10-16 23:10:56 +0300
commit35fbfb19a173b01bc881f2bbc5d104136633a7ec (patch)
tree636d0d51fa262dc808eb3c5cc9cf92ad977a0c6a /tpl/resources
parent3a3089121b852332b5744d1f566959c8cf93cef4 (diff)
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 'tpl/resources')
-rw-r--r--tpl/resources/resources.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/tpl/resources/resources.go b/tpl/resources/resources.go
index 883afbcd7..c24cd2b42 100644
--- a/tpl/resources/resources.go
+++ b/tpl/resources/resources.go
@@ -18,6 +18,8 @@ import (
"fmt"
"path/filepath"
+ _errors "github.com/pkg/errors"
+
"github.com/gohugoio/hugo/deps"
"github.com/gohugoio/hugo/resource"
"github.com/gohugoio/hugo/resource/bundler"
@@ -256,7 +258,7 @@ func (ns *Namespace) resolveArgs(args []interface{}) (resource.Resource, map[str
m, err := cast.ToStringMapE(args[0])
if err != nil {
- return nil, nil, fmt.Errorf("invalid options type: %s", err)
+ return nil, nil, _errors.Wrap(err, "invalid options type")
}
return r, m, nil