diff --git a/cli/ssh.go b/cli/ssh.go index 81eacc33f0..d3d2b36c53 100644 --- a/cli/ssh.go +++ b/cli/ssh.go @@ -2,6 +2,7 @@ package cli import ( "context" + "errors" "fmt" "io" "os" @@ -231,6 +232,11 @@ func ssh() *cobra.Command { err = sshSession.Wait() if err != nil { + // If the connection drops unexpectedly, we get an ExitMissingError but no other + // error details, so try to at least give the user a better message + if errors.Is(err, &gossh.ExitMissingError{}) { + return xerrors.New("SSH connection ended unexpectedly") + } return err }