mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Make sure module config loading errors have file positioning info
Fixes #8845
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user