From b6b57bcfe86d11d2cfac7ce76cdb3f0f3a3ac910 Mon Sep 17 00:00:00 2001 From: rosstimothy <39066650+rosstimothy@users.noreply.github.com> Date: Fri, 21 Apr 2023 16:36:47 -0400 Subject: [PATCH] Unify errors returned from ProxyClient when targets are ambiguous (#25004) Ensures that SSH and gRPC connections via `tsh` return the same error when dialing a host fails. Closes #24943 --- api/client/proxy/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/client/proxy/client.go b/api/client/proxy/client.go index 678e4a44126..3f5c88c6928 100644 --- a/api/client/proxy/client.go +++ b/api/client/proxy/client.go @@ -519,7 +519,7 @@ func (c *Client) DialHost(ctx context.Context, target, cluster string, keyring a conn, details, err := c.transport.DialHost(ctx, target, cluster, nil, keyring) if err != nil { - return nil, ClusterDetails{}, trace.Wrap(err) + return nil, ClusterDetails{}, trace.ConnectionProblem(err, "failed connecting to host %s: %v", target, err) } return conn, ClusterDetails{FIPS: details.FipsEnabled}, nil