aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser/metadecoders
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2018-10-20 19:09:03 +0200
committerBjørn Erik Pedersen <[email protected]>2018-10-22 20:46:14 +0200
commit7930d2132a3c36c1aaca20f16f56978c84656b0a (patch)
tree4a83047bf4d531a22dc6b344ca42e42ed8dabba4 /parser/metadecoders
parenteb038cfa0a8ada29dfcba1204ec5c432da9ed7e0 (diff)
downloadhugo-7930d2132a3c36c1aaca20f16f56978c84656b0a.tar.gz
hugo-7930d2132a3c36c1aaca20f16f56978c84656b0a.zip
hugolib: Remove the now superflous Source struct
See #5324
Diffstat (limited to 'parser/metadecoders')
-rw-r--r--parser/metadecoders/decoder.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/parser/metadecoders/decoder.go b/parser/metadecoders/decoder.go
index e409b7665..0cb6afa5b 100644
--- a/parser/metadecoders/decoder.go
+++ b/parser/metadecoders/decoder.go
@@ -59,7 +59,7 @@ func unmarshal(data []byte, f Format, v interface{}) error {
case ORG:
vv, err := goorgeous.OrgHeaders(data)
if err != nil {
- return err
+ return errors.Wrap(err, "failed to unmarshal ORG headers")
}
switch v.(type) {
case *map[string]interface{}:
@@ -73,6 +73,9 @@ func unmarshal(data []byte, f Format, v interface{}) error {
err = toml.Unmarshal(data, v)
case YAML:
err = yaml.Unmarshal(data, v)
+ if err != nil {
+ return errors.Wrap(err, "failed to unmarshal YAML")
+ }
// To support boolean keys, the YAML package unmarshals maps to
// map[interface{}]interface{}. Here we recurse through the result
@@ -100,7 +103,7 @@ func unmarshal(data []byte, f Format, v interface{}) error {
return errors.Errorf("unmarshal of format %q is not supported", f)
}
- return err
+ return errors.Wrap(err, "unmarshal failed")
}