From 369ea534b67add703502849909db3c7f2767e277 Mon Sep 17 00:00:00 2001 From: Jason Lunz Date: Thu, 16 Dec 2021 16:52:07 -0700 Subject: [PATCH] explain why failure to connect to a codespace doesn't fail the entire command --- pkg/cmd/codespace/ssh.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/codespace/ssh.go b/pkg/cmd/codespace/ssh.go index 7dfce6ec4..9e35bc544 100644 --- a/pkg/cmd/codespace/ssh.go +++ b/pkg/cmd/codespace/ssh.go @@ -212,6 +212,10 @@ func (a *App) printOpenSSHConfig(ctx context.Context, opts configOptions) error session, err := openSSHSession(ctx, a, cs.Name, nil) if err != nil { fmt.Fprintf(os.Stderr, "error connecting to codespace: %v\n", err) + + // Move on to the next codespace. We don't want to bail here - just because we're not + // able to set up connectivity to one doesn't mean we shouldn't make a best effort to + // generate configs for the rest of them. continue } defer session.Close() @@ -221,7 +225,7 @@ func (a *App) printOpenSSHConfig(ctx context.Context, opts configOptions) error a.StopProgressIndicator() if err != nil { fmt.Fprintf(os.Stderr, "error getting ssh server details: %v", err) - continue + continue // see above } sshUsers[cs.Repository.FullName] = sshUser }