config: return an error if unable to parse values in the config file
This commit is contained in:
parent
c5ece1e509
commit
e23f889639
@ -345,8 +345,15 @@ func loadConfig() (*config, error) {
|
||||
var configFileError error
|
||||
cfg := preCfg
|
||||
if err := flags.IniParse(configFilePath, &cfg); err != nil {
|
||||
// If it's a parsing related error, then we'll return
|
||||
// immediately, otherwise we can proceed as possibly the config
|
||||
// file doesn't exist which is OK.
|
||||
if _, ok := err.(*flags.IniError); ok {
|
||||
return nil, err
|
||||
} else {
|
||||
configFileError = err
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, parse the remaining command line options again to ensure
|
||||
// they take precedence.
|
||||
|
Loading…
Reference in New Issue
Block a user