diff --git a/src/cmd/common/viper.go b/src/cmd/common/viper.go index a28e30544e..e161c22d00 100644 --- a/src/cmd/common/viper.go +++ b/src/cmd/common/viper.go @@ -167,9 +167,11 @@ func printViperConfigUsed() { if !vInitialized { return } - // Optional, so ignore file not found errors - var notFoundErr *viper.ConfigFileNotFoundError - if vConfigError != nil && !errors.As(vConfigError, ¬FoundErr) { + var notFoundErr viper.ConfigFileNotFoundError + if errors.As(vConfigError, ¬FoundErr) { + return + } + if vConfigError != nil { message.WarnErrf(vConfigError, lang.CmdViperErrLoadingConfigFile, vConfigError.Error()) return }