Skip to content

Commit 64eecef

Browse files
committed
Remove unhelpful error wrapper
1 parent a2f76fd commit 64eecef

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

pkg/cmd/codespace/code.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func newCodeCmd(app *App) *cobra.Command {
3333
func (a *App) VSCode(ctx context.Context, codespaceName string, useInsiders bool) error {
3434
codespace, err := getOrChooseCodespace(ctx, a.apiClient, codespaceName)
3535
if err != nil {
36-
return fmt.Errorf("get or choose codespace: %w", err)
36+
return err
3737
}
3838

3939
url := vscodeProtocolURL(codespace.Name, useInsiders)

pkg/cmd/codespace/code_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestPendingOperationDisallowsCode(t *testing.T) {
5858
app := testingCodeApp()
5959

6060
if err := app.VSCode(context.Background(), "disabledCodespace", false); err != nil {
61-
if err.Error() != "get or choose codespace: codespace is disabled while it has a pending operation: Some pending operation" {
61+
if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" {
6262
t.Errorf("expected pending operation error, but got: %v", err)
6363
}
6464
} else {

pkg/cmd/codespace/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (a *App) Logs(ctx context.Context, codespaceName string, follow bool) (err
3838

3939
codespace, err := getOrChooseCodespace(ctx, a.apiClient, codespaceName)
4040
if err != nil {
41-
return fmt.Errorf("get or choose codespace: %w", err)
41+
return err
4242
}
4343

4444
authkeys := make(chan error, 1)

pkg/cmd/codespace/logs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func TestPendingOperationDisallowsLogs(t *testing.T) {
1212
app := testingLogsApp()
1313

1414
if err := app.Logs(context.Background(), "disabledCodespace", false); err != nil {
15-
if err.Error() != "get or choose codespace: codespace is disabled while it has a pending operation: Some pending operation" {
15+
if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" {
1616
t.Errorf("expected pending operation error, but got: %v", err)
1717
}
1818
} else {

pkg/cmd/codespace/ssh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (a *App) SSH(ctx context.Context, sshArgs []string, opts sshOptions) (err e
125125

126126
codespace, err := getOrChooseCodespace(ctx, a.apiClient, opts.codespace)
127127
if err != nil {
128-
return fmt.Errorf("get or choose codespace: %w", err)
128+
return err
129129
}
130130

131131
liveshareLogger := noopLogger()

pkg/cmd/codespace/ssh_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func TestPendingOperationDisallowsSSH(t *testing.T) {
1212
app := testingSSHApp()
1313

1414
if err := app.SSH(context.Background(), []string{}, sshOptions{codespace: "disabledCodespace"}); err != nil {
15-
if err.Error() != "get or choose codespace: codespace is disabled while it has a pending operation: Some pending operation" {
15+
if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" {
1616
t.Errorf("expected pending operation error, but got: %v", err)
1717
}
1818
} else {

0 commit comments

Comments
 (0)