config: Appropriate error message when newer config file is found (#3972)

master
Krishna Srinivas 8 years ago committed by Harshavardhana
parent a8cb43926a
commit 9ee83b89bb
  1. 5
      cmd/config-v17.go
  2. 2
      cmd/server-main.go

@ -215,9 +215,10 @@ func validateConfig() error {
return err
}
// Check if config version is valid
if srvCfg.Version != v17 {
return errors.New("bad config version, expected: " + v17)
// Older binary but newer config version.
// Config version can never be older as it would have migrated.
return fmt.Errorf("Expected config version: %s, newer config version found: %s", v17, srvCfg.Version)
}
// Load config file json and check for duplication json keys

@ -169,7 +169,7 @@ func initConfig() {
// Validate config file
err = validateConfig()
fatalIf(err, "Cannot validate configuration file")
fatalIf(err, "Unable to validate configuration file")
// Once we have migrated all the old config, now load them.
err = loadConfig(envs)

Loading…
Cancel
Save