Wrap error cause so that we can understand why the cli cannot determine current context.

This happened in Desktop WSL2 tests, we’re blind here : https://ci-next.docker.com/teams-desktop/blue/organizations/jenkins/desktop%2Fdesktop-test-single-pr-win/detail/desktop-test-single-pr-win/120692/pipeline
This commit is contained in:
Guillaume Tardif 2020-06-13 16:25:29 +02:00
parent f19fe9e188
commit dda4b0f3bf
2 changed files with 2 additions and 2 deletions

View File

@ -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))

View File

@ -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 {