From 64eecef17636627abbc20ff07ac09fcd1244637b Mon Sep 17 00:00:00 2001 From: Charlie Andrews Date: Wed, 16 Mar 2022 09:36:14 -0400 Subject: [PATCH] Remove unhelpful error wrapper --- pkg/cmd/codespace/code.go | 2 +- pkg/cmd/codespace/code_test.go | 2 +- pkg/cmd/codespace/logs.go | 2 +- pkg/cmd/codespace/logs_test.go | 2 +- pkg/cmd/codespace/ssh.go | 2 +- pkg/cmd/codespace/ssh_test.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/codespace/code.go b/pkg/cmd/codespace/code.go index ba2455385..0942d15d3 100644 --- a/pkg/cmd/codespace/code.go +++ b/pkg/cmd/codespace/code.go @@ -33,7 +33,7 @@ func newCodeCmd(app *App) *cobra.Command { func (a *App) VSCode(ctx context.Context, codespaceName string, useInsiders bool) error { codespace, err := getOrChooseCodespace(ctx, a.apiClient, codespaceName) if err != nil { - return fmt.Errorf("get or choose codespace: %w", err) + return err } url := vscodeProtocolURL(codespace.Name, useInsiders) diff --git a/pkg/cmd/codespace/code_test.go b/pkg/cmd/codespace/code_test.go index eda616a20..30f06bd39 100644 --- a/pkg/cmd/codespace/code_test.go +++ b/pkg/cmd/codespace/code_test.go @@ -58,7 +58,7 @@ func TestPendingOperationDisallowsCode(t *testing.T) { app := testingCodeApp() if err := app.VSCode(context.Background(), "disabledCodespace", false); err != nil { - if err.Error() != "get or choose codespace: codespace is disabled while it has a pending operation: Some pending operation" { + if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" { t.Errorf("expected pending operation error, but got: %v", err) } } else { diff --git a/pkg/cmd/codespace/logs.go b/pkg/cmd/codespace/logs.go index d0a0c233b..6feab3080 100644 --- a/pkg/cmd/codespace/logs.go +++ b/pkg/cmd/codespace/logs.go @@ -38,7 +38,7 @@ func (a *App) Logs(ctx context.Context, codespaceName string, follow bool) (err codespace, err := getOrChooseCodespace(ctx, a.apiClient, codespaceName) if err != nil { - return fmt.Errorf("get or choose codespace: %w", err) + return err } authkeys := make(chan error, 1) diff --git a/pkg/cmd/codespace/logs_test.go b/pkg/cmd/codespace/logs_test.go index 225e10680..1eaf2e9d9 100644 --- a/pkg/cmd/codespace/logs_test.go +++ b/pkg/cmd/codespace/logs_test.go @@ -12,7 +12,7 @@ func TestPendingOperationDisallowsLogs(t *testing.T) { app := testingLogsApp() if err := app.Logs(context.Background(), "disabledCodespace", false); err != nil { - if err.Error() != "get or choose codespace: codespace is disabled while it has a pending operation: Some pending operation" { + if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" { t.Errorf("expected pending operation error, but got: %v", err) } } else { diff --git a/pkg/cmd/codespace/ssh.go b/pkg/cmd/codespace/ssh.go index 6ce783f2f..dfbc75694 100644 --- a/pkg/cmd/codespace/ssh.go +++ b/pkg/cmd/codespace/ssh.go @@ -125,7 +125,7 @@ func (a *App) SSH(ctx context.Context, sshArgs []string, opts sshOptions) (err e codespace, err := getOrChooseCodespace(ctx, a.apiClient, opts.codespace) if err != nil { - return fmt.Errorf("get or choose codespace: %w", err) + return err } liveshareLogger := noopLogger() diff --git a/pkg/cmd/codespace/ssh_test.go b/pkg/cmd/codespace/ssh_test.go index fac5147bb..3b242ae4b 100644 --- a/pkg/cmd/codespace/ssh_test.go +++ b/pkg/cmd/codespace/ssh_test.go @@ -12,7 +12,7 @@ func TestPendingOperationDisallowsSSH(t *testing.T) { app := testingSSHApp() if err := app.SSH(context.Background(), []string{}, sshOptions{codespace: "disabledCodespace"}); err != nil { - if err.Error() != "get or choose codespace: codespace is disabled while it has a pending operation: Some pending operation" { + if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" { t.Errorf("expected pending operation error, but got: %v", err) } } else {