19166: Improve error messages.
authorTom Clegg <tom@curii.com>
Tue, 5 Jul 2022 13:57:23 +0000 (09:57 -0400)
committerTom Clegg <tom@curii.com>
Tue, 5 Jul 2022 13:57:23 +0000 (09:57 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/controller/localdb/container_gateway.go
lib/controller/rpc/conn.go

index 90c95deb35444e6d27efa02958dc71ebe287c779..77c5182e9cd924460b81a39770f647baefb3af19 100644 (file)
@@ -187,7 +187,7 @@ func (conn *Conn) ContainerSSH(ctx context.Context, opts arvados.ContainerSSHOpt
        })
        err = tlsconn.HandshakeContext(ctx)
        if err != nil {
-               return sshconn, httpserver.ErrorWithStatus(err, http.StatusBadGateway)
+               return sshconn, httpserver.ErrorWithStatus(fmt.Errorf("TLS handshake failed: %w", err), http.StatusBadGateway)
        }
        if respondAuth == "" {
                tlsconn.Close()
index 1475a5e01fb0546c54fddf4856759ed587719255..0e532f23c070d8b5c64a15bd8bef46494702ae5a 100644 (file)
@@ -414,7 +414,7 @@ func (conn *Conn) socket(ctx context.Context, u *url.URL, upgradeHeader string,
                } else {
                        message = fmt.Sprintf("%q", body)
                }
-               return connresp, fmt.Errorf("server did not provide a tunnel: %s %s", resp.Status, message)
+               return connresp, fmt.Errorf("server did not provide a tunnel: %s: %s", resp.Status, message)
        }
        if strings.ToLower(resp.Header.Get("Upgrade")) != upgradeHeader ||
                strings.ToLower(resp.Header.Get("Connection")) != "upgrade" {