From abeb03b0904abeff4af7f35682a6e53bcb420b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Marku=C5=A1i=C4=87?= Date: Sat, 28 May 2022 17:23:14 +0200 Subject: [PATCH 1/2] Add helpful message on unmarshall error --- pkg/config/app_config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 2d80c309b..58a5d8983 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -1,6 +1,7 @@ package config import ( + "fmt" "io/ioutil" "os" "path/filepath" @@ -167,7 +168,7 @@ func loadUserConfig(configFiles []string, base *UserConfig) (*UserConfig, error) } if err := yaml.Unmarshal(content, base); err != nil { - return nil, err + return nil, fmt.Errorf("The config at `%s` couldn't be parsed, please inspect it before opening up an issue.", path) } } From abf203e0121e36a4db55ad59e4a9a93ed9b20542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Marku=C5=A1i=C4=87?= Date: Tue, 31 May 2022 13:28:24 +0200 Subject: [PATCH 2/2] Update pkg/config/app_config.go Print out error to narrow down the search Co-authored-by: Ryoga --- pkg/config/app_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 58a5d8983..883d0d030 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -168,7 +168,7 @@ func loadUserConfig(configFiles []string, base *UserConfig) (*UserConfig, error) } if err := yaml.Unmarshal(content, base); err != nil { - return nil, fmt.Errorf("The config at `%s` couldn't be parsed, please inspect it before opening up an issue.", path) + return nil, fmt.Errorf("The config at `%s` couldn't be parsed, please inspect it before opening up an issue.\n%w", path, err) } }