Merge pull request #211 from docker/wrap_context_error

Wrap error cause so that we can understand why the cli cannot determine current context
This commit is contained in:
Guillaume Tardif 2020-06-15 09:58:00 +02:00 committed by GitHub
commit bc1b2b778a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {