mirror of
https://github.com/spf13/viper.git
synced 2026-10-21 04:11:04 +00:00
fix: wrap file not found error
This commit is contained in:
committed by
Márk Sági-Kazár
parent
3c673554b5
commit
3504ce391d
@@ -1497,7 +1497,7 @@ func (v *Viper) ReadInConfig() error {
|
||||
if err != nil {
|
||||
if errors.As(err, &pathError) {
|
||||
// The specified config file is missing
|
||||
return FileNotFoundError{path: filename}
|
||||
return FileNotFoundError{err: err, path: filename}
|
||||
} else {
|
||||
// We hit some other error from the filesystem that isn't a missing file
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user