Browse code

Add a better error message when we get an unknown http issue

Closes #5184

Signed-off-by: Doug Davis <dug@us.ibm.com>

Doug Davis authored on 2014/10/02 05:17:29
Showing 1 changed files
... ...
@@ -96,7 +96,12 @@ func (cli *DockerCli) call(method, path string, data interface{}, passAuthInfo b
96 96
 		if strings.Contains(err.Error(), "connection refused") {
97 97
 			return nil, -1, ErrConnectionRefused
98 98
 		}
99
-		return nil, -1, err
99
+
100
+		if cli.tlsConfig == nil {
101
+			return nil, -1, fmt.Errorf("%v. Are you trying to connect to a TLS-enabled daemon without TLS?", err)
102
+		}
103
+		return nil, -1, fmt.Errorf("An error occurred trying to connect: %v", err)
104
+
100 105
 	}
101 106
 
102 107
 	if resp.StatusCode < 200 || resp.StatusCode >= 400 {