From c5f5de08f18c8c185fd82d88c02813c5fe12e36b Mon Sep 17 00:00:00 2001 From: Victor Castell Date: Fri, 28 Dec 2018 18:22:44 +0100 Subject: [PATCH] Report errors on unmarshal config --- cmd/dkron.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/dkron.go b/cmd/dkron.go index 47a11e001..36094aef9 100644 --- a/cmd/dkron.go +++ b/cmd/dkron.go @@ -61,15 +61,17 @@ func initConfig() { logrus.WithError(err).Info("No valid config found: Applying default values.") } - viper.Unmarshal(config) + if err := viper.Unmarshal(config); err != nil { + logrus.WithError(err).Fatal("config: Error unmarshaling config") + } cliTags := viper.GetStringSlice("tag") var tags map[string]string if len(cliTags) > 0 { - tags, err = unmarshalTags(cliTags) + tags, err = UnmarshalTags(cliTags) if err != nil { - logrus.Fatal("config: Error unmarshaling cli tags") + logrus.WithError(err).Fatal("config: Error unmarshaling cli tags") } } else { tags = viper.GetStringMapString("tags")