From 3bbd02a1ca4338dfe4cd1306ba14513e215b8a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 11 Nov 2015 22:47:09 +0100 Subject: [PATCH] Print parse errors from Viper --- commands/hugo.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/hugo.go b/commands/hugo.go index ec49232ab..edd80daab 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -185,7 +185,11 @@ func InitializeConfig() { } err := viper.ReadInConfig() if err != nil { - jww.ERROR.Println("Unable to locate Config file. Perhaps you need to create a new site. Run `hugo help new` for details") + if _, ok := err.(viper.ConfigParseError); ok { + jww.ERROR.Println(err) + } else { + jww.ERROR.Println("Unable to locate Config file. Perhaps you need to create a new site. Run `hugo help new` for details", err) + } } viper.RegisterAlias("indexes", "taxonomies")