diff options
Diffstat (limited to 'config/configLoader.go')
-rw-r--r-- | config/configLoader.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/config/configLoader.go b/config/configLoader.go index 76a7e2635..6bbad7002 100644 --- a/config/configLoader.go +++ b/config/configLoader.go @@ -14,14 +14,13 @@ package config import ( + "fmt" "os" "path/filepath" "strings" "github.com/gohugoio/hugo/common/herrors" - "github.com/pkg/errors" - "github.com/gohugoio/hugo/common/paths" "github.com/gohugoio/hugo/common/maps" @@ -60,7 +59,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, herrors.WithFileContextForFileDefault(err, filename, fs) + return nil, herrors.NewFileErrorFromFile(err, filename, filename, fs, herrors.SimpleLineMatcher) } return NewFrom(m), nil } @@ -132,7 +131,7 @@ func LoadConfigFromDir(sourceFs afero.Fs, configDir, environment string) (Provid if err != nil { // This will be used in error reporting, use the most specific value. dirnames = []string{path} - return errors.Wrapf(err, "failed to unmarshl config for path %q", path) + return fmt.Errorf("failed to unmarshl config for path %q: %w", path, err) } var keyPath []string |