aboutsummaryrefslogtreecommitdiffhomepage
path: root/config/configLoader.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2021-08-03 09:57:14 +0200
committerBjørn Erik Pedersen <[email protected]>2021-08-03 09:57:14 +0200
commitd70c485707edfd445bcfc0e84181bc15eb146e76 (patch)
treeffc5421ae0e102388511054e01d220340f10b2b4 /config/configLoader.go
parent9ff17c332405da5830cef9b3711706b1fc9a7444 (diff)
downloadhugo-d70c485707edfd445bcfc0e84181bc15eb146e76.tar.gz
hugo-d70c485707edfd445bcfc0e84181bc15eb146e76.zip
Make sure module config loading errors have file positioning info
Fixes #8845
Diffstat (limited to 'config/configLoader.go')
-rw-r--r--config/configLoader.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/config/configLoader.go b/config/configLoader.go
index 8dcfcbdcc..145b95d7d 100644
--- a/config/configLoader.go
+++ b/config/configLoader.go
@@ -18,6 +18,8 @@ import (
"path/filepath"
"strings"
+ "github.com/gohugoio/hugo/common/herrors"
+
"github.com/pkg/errors"
"github.com/gohugoio/hugo/common/paths"
@@ -58,7 +60,7 @@ func FromConfigString(config, configType string) (Provider, error) {
func FromFile(fs afero.Fs, filename string) (Provider, error) {
m, err := loadConfigFromFile(fs, filename)
if err != nil {
- return nil, err
+ return nil, herrors.WithFileContextForFileDefault(err, filename, fs)
}
return NewFrom(m), nil
}