浏览代码

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 10 年之前
父节点
当前提交
6fdaa66652
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      api/client/utils.go

+ 6 - 1
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 {