From 6e26392209cba2758a36fe37f125ecdfc22db5fa Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Wed, 28 Mar 2018 15:35:52 +0200 Subject: [PATCH] Return config parse errors (#182) --- cli/setup.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cli/setup.go b/cli/setup.go index dc34abdf..06cf1cd1 100644 --- a/cli/setup.go +++ b/cli/setup.go @@ -139,9 +139,8 @@ func bindFlagsLoadViper(cmd *cobra.Command, args []string) error { // stderr, so if we redirect output to json file, this doesn't appear // fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed()) } else if _, ok := err.(viper.ConfigFileNotFoundError); !ok { - // we ignore not found error, only parse error - // stderr, so if we redirect output to json file, this doesn't appear - fmt.Fprintf(os.Stderr, "%#v", err) + // ignore not found error, return other errors + return err } return nil }