From 6fdaa66652d65558d8225d58f3ac48904ebac1de Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Wed, 1 Oct 2014 13:17:29 -0700 Subject: [PATCH] Add a better error message when we get an unknown http issue Closes #5184 Signed-off-by: Doug Davis --- api/client/utils.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/client/utils.go b/api/client/utils.go index 11e39729af..6fad9db10d 100644 --- a/api/client/utils.go +++ b/api/client/utils.go @@ -96,7 +96,12 @@ func (cli *DockerCli) call(method, path string, data interface{}, passAuthInfo b if strings.Contains(err.Error(), "connection refused") { return nil, -1, ErrConnectionRefused } - return nil, -1, err + + if cli.tlsConfig == nil { + return nil, -1, fmt.Errorf("%v. Are you trying to connect to a TLS-enabled daemon without TLS?", err) + } + return nil, -1, fmt.Errorf("An error occurred trying to connect: %v", err) + } if resp.StatusCode < 200 || resp.StatusCode >= 400 {