Log error on failure to read config file

- include actual error to highlight the specific issue
This commit is contained in:
Rob Mulholand 2019-06-27 09:38:00 -05:00
parent 7092d33338
commit 62cca62432

View File

@ -138,8 +138,8 @@ func initConfig() {
log.Printf("Using config file: %s\n\n", viper.ConfigFileUsed())
} else {
invalidConfigError := "Couldn't read config file"
fmt.Println("Error: ", invalidConfigError)
log.Fatal(invalidConfigError)
formattedError := fmt.Sprintf("%s: %s", invalidConfigError, err.Error())
log.Fatal(formattedError)
}
}