From dda4b0f3bfd57d7e83dd05d42809ff1ab6ef4641 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Sat, 13 Jun 2020 16:25:29 +0200 Subject: [PATCH] =?UTF-8?q?Wrap=20error=20cause=20so=20that=20we=20can=20u?= =?UTF-8?q?nderstand=20why=20the=20cli=20cannot=20determine=20current=20co?= =?UTF-8?q?ntext.=20This=20happened=20in=20Desktop=20WSL2=20tests,=20we?= =?UTF-8?q?=E2=80=99re=20blind=20here=20:=20https://ci-next.docker.com/tea?= =?UTF-8?q?ms-desktop/blue/organizations/jenkins/desktop%2Fdesktop-test-si?= =?UTF-8?q?ngle-pr-win/detail/desktop-test-single-pr-win/120692/pipeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cli/main.go | 2 +- config/config.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/main.go b/cli/main.go index 10e50f13..04e92fca 100644 --- a/cli/main.go +++ b/cli/main.go @@ -150,7 +150,7 @@ func main() { currentContext, err := determineCurrentContext(opts.Context, configDir) if err != nil { - fatal(errors.New("unable to determine current context")) + fatal(errors.Wrap(err, "unable to determine current context")) } s, err := store.New(store.WithRoot(configDir)) diff --git a/config/config.go b/config/config.go index 49058a7d..f55a6f7f 100644 --- a/config/config.go +++ b/config/config.go @@ -99,7 +99,7 @@ func loadFile(path string, dest interface{}) error { return errors.Wrap(err, "unable to read config file") } err = json.Unmarshal(data, dest) - return errors.Wrap(err, "unable to unmarshal config") + return errors.Wrap(err, "unable to unmarshal config file "+path) } func configFilePath(dir string) string {