X Tutup
Skip to content

Commit 369ea53

Browse files
committed
explain why failure to connect to a codespace doesn't fail the entire command
1 parent 4a6887f commit 369ea53

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/cmd/codespace/ssh.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ func (a *App) printOpenSSHConfig(ctx context.Context, opts configOptions) error
212212
session, err := openSSHSession(ctx, a, cs.Name, nil)
213213
if err != nil {
214214
fmt.Fprintf(os.Stderr, "error connecting to codespace: %v\n", err)
215+
216+
// Move on to the next codespace. We don't want to bail here - just because we're not
217+
// able to set up connectivity to one doesn't mean we shouldn't make a best effort to
218+
// generate configs for the rest of them.
215219
continue
216220
}
217221
defer session.Close()
@@ -221,7 +225,7 @@ func (a *App) printOpenSSHConfig(ctx context.Context, opts configOptions) error
221225
a.StopProgressIndicator()
222226
if err != nil {
223227
fmt.Fprintf(os.Stderr, "error getting ssh server details: %v", err)
224-
continue
228+
continue // see above
225229
}
226230
sshUsers[cs.Repository.FullName] = sshUser
227231
}

0 commit comments

Comments
 (0)
X Tutup