{"record":{"id":"0531383b22472d78","repo":"ahmetb/kubectx","slug":"failed-to-delete-context-w","errorCode":null,"errorMessage":"failed to delete context: %w","messagePattern":"failed to delete context: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kubectx/fzf.go","lineNumber":140,"sourceCode":"\tcmd.Stdout = &out\n\n\tcmd.Env = append(os.Environ(),\n\t\tfmt.Sprintf(\"%s=1\", env.EnvForceColor))\n\tif err := cmd.Run(); err != nil {\n\t\tvar exitErr *exec.ExitError\n\t\tif !errors.As(err, &exitErr) {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tchoice := strings.TrimSpace(out.String())\n\tif choice == \"\" {\n\t\treturn errors.New(\"you did not choose any of the options\")\n\t}\n\n\tname, wasActiveContext, err := deleteContext(choice)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to delete context: %w\", err)\n\t}\n\n\tif wasActiveContext {\n\t\tprinter.Warning(stderr, \"You deleted the current context. Use \\\"%s\\\" to select a new context.\",\n\t\t\tselfName())\n\t}\n\n\t_ = printer.Success(stderr, `Deleted context %s.`, printer.SuccessColor.Sprint(name))\n\n\treturn nil\n}\n","sourceCodeStart":122,"sourceCodeEnd":152,"githubUrl":"https://github.com/ahmetb/kubectx/blob/12ad6fb22e8c546ee2b54e7de38aa51c906832f7/cmd/kubectx/fzf.go#L122-L152","documentation":"Wrapper error in InteractiveDeleteOp.Run: deleteContext(choice) failed after the user selected a context in the fzf delete menu (parse, existence check, YAML modify, or save failure). Wrapped with %w so the root step is visible.","triggerScenarios":"Thrown at cmd/kubectx/fzf.go:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped cause to identify the failing step","Verify the kubeconfig is valid and writable, then retry the delete"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"12ad6fb22e8c546ee2b54e7de38aa51c906832f7","analyzedAt":"2026-09-02T12:23:10.107Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}