Report errors when opening config files am: 15cd21a492
am: aa14355b6a
am: 2077c15150
Change-Id: Ia4e8bda652317eed42a9e559f881eddf5a6ada12
This commit is contained in:
@@ -132,12 +132,14 @@ func loadFromConfigFile(configurable jsonConfigurable, filename string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err != nil {
|
||||
return fmt.Errorf("config file: could not open %s: %s", filename, err.Error())
|
||||
} else {
|
||||
// Make a decoder for it
|
||||
jsonDecoder := json.NewDecoder(configFileReader)
|
||||
err = jsonDecoder.Decode(configurable)
|
||||
if err != nil {
|
||||
return fmt.Errorf("config file: %s did not parse correctly: "+err.Error(), filename)
|
||||
return fmt.Errorf("config file: %s did not parse correctly: %s", filename, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user