From 76195bb3ac98dfdd38aea37ef6e11cb36542019d Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 12 Jun 2022 13:32:16 +0000 Subject: [PATCH] Add warn if configuration could not be found --- config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.go b/config.go index 212fe154..332f79f7 100644 --- a/config.go +++ b/config.go @@ -163,9 +163,13 @@ func LoadConfig(path string, isFile bool) error { viper.SetDefault("ephemeral_node_inactivity_timeout", "120s") if err := viper.ReadInConfig(); err != nil { + log.Warn().Err(err).Msg("Failed to read configuration from disk") + return fmt.Errorf("fatal error reading config file: %w", err) } + log.Debug().Str("path", viper.ConfigFileUsed()).Msg("Read configuration from disk") + // Collect any validation errors and return them all at once var errorText string if (viper.GetString("tls_letsencrypt_hostname") != "") &&