{"record":{"id":"d4a42907fde9460a","repo":"cli/cli","slug":"error-choosing-codespace-w-d4a429","errorCode":null,"errorMessage":"error choosing codespace: %w","messagePattern":"error choosing codespace: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/codespace/edit.go","lineNumber":54,"sourceCode":"\teditCmd.Flags().StringVarP(&opts.displayName, \"display-name\", \"d\", \"\", \"Set the display name\")\n\teditCmd.Flags().StringVar(&opts.displayName, \"displayName\", \"\", \"Display name\")\n\tif err := editCmd.Flags().MarkDeprecated(\"displayName\", \"use `--display-name` instead\"); err != nil {\n\t\tfmt.Fprintf(app.io.ErrOut, \"error marking flag as deprecated: %v\\n\", err)\n\t}\n\teditCmd.Flags().StringVarP(&opts.machine, \"machine\", \"m\", \"\", \"Set hardware specifications for the VM\")\n\n\treturn editCmd\n}\n\n// Edits a codespace\nfunc (a *App) Edit(ctx context.Context, opts editOptions) error {\n\tcodespaceName, err := opts.selector.SelectName(ctx)\n\tif err != nil {\n\t\t// TODO: is there a cleaner way to do this?\n\t\tif errors.Is(err, errNoCodespaces) || errors.Is(err, errNoFilteredCodespaces) {\n\t\t\treturn err\n\t\t}\n\t\treturn fmt.Errorf(\"error choosing codespace: %w\", err)\n\t}\n\n\terr = a.RunWithProgress(\"Editing codespace\", func() (err error) {\n\t\t_, err = a.apiClient.EditCodespace(ctx, codespaceName, &api.EditCodespaceParams{\n\t\t\tDisplayName: opts.displayName,\n\t\t\tMachine:     opts.machine,\n\t\t})\n\t\treturn\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error editing codespace: %w\", err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":36,"sourceCodeEnd":70,"githubUrl":"https://github.com/cli/cli/blob/0eeec0b92edbe70199f9768522f831d3534f41ad/pkg/cmd/codespace/edit.go#L36-L70","documentation":"Error \"error choosing codespace: %w\" thrown in cli/cli.","triggerScenarios":"Thrown at pkg/cmd/codespace/edit.go:54 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass --codespace NAME to select the codespace directly, or run in a terminal."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eeec0b92edbe70199f9768522f831d3534f41ad","analyzedAt":"2026-08-15T12:31:05.478Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}