diff --git a/conf/configuration.go b/conf/configuration.go index 9f6599f7c..1d98daffd 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -103,12 +103,12 @@ func LoadFromFile(confFile string) { func Load() { err := viper.Unmarshal(&Server) if err != nil { - fmt.Println("Error parsing config:", err) + fmt.Println("FATAL: Error parsing config:", err) os.Exit(1) } err = os.MkdirAll(Server.DataFolder, os.ModePerm) if err != nil { - fmt.Println("Error creating data path:", "path", Server.DataFolder, err) + fmt.Println("FATAL: Error creating data path:", "path", Server.DataFolder, err) os.Exit(1) } Server.ConfigFile = viper.GetViper().ConfigFileUsed() @@ -254,8 +254,8 @@ func InitConfig(cfgFile string) { viper.AutomaticEnv() err := viper.ReadInConfig() - if cfgFile != "" && err != nil { - fmt.Println("Navidrome could not open config file: ", err) + if viper.ConfigFileUsed() != "" && err != nil { + fmt.Println("FATAL: Navidrome could not open config file: ", err) os.Exit(1) } }