{"id":"635491a3e1c20f05","repo":"docker/cli","slug":"context-q-does-not-exist","errorCode":null,"errorMessage":"context %q does not exist","messagePattern":"context %q does not exist","errorType":"exception","errorClass":"notFoundErr","httpStatus":null,"severity":"error","filePath":"cli/command/context/remove.go","lineNumber":78,"sourceCode":"\t\t\treturn err\n\t\t}\n\t}\n\n\tif !force {\n\t\t// TODO(thaJeztah): instead of checking before removing, can we make ContextStore().Remove() return a proper errdef and ignore \"not found\" errors?\n\t\tif err := checkContextExists(dockerCli, name); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn dockerCli.ContextStore().Remove(name)\n}\n\n// checkContextExists returns an error if the context directory does not exist.\nfunc checkContextExists(dockerCli command.Cli, name string) error {\n\tcontextDir := dockerCli.ContextStore().GetStorageInfo(name).MetadataPath\n\t_, err := os.Stat(contextDir)\n\tif os.IsNotExist(err) {\n\t\treturn notFoundErr{fmt.Errorf(\"context %q does not exist\", name)}\n\t}\n\t// Ignore other errors; if relevant, they will produce an error when\n\t// performing the actual delete.\n\treturn nil\n}\n\ntype notFoundErr struct{ error }\n\nfunc (notFoundErr) NotFound() {}\n","sourceCodeStart":60,"sourceCodeEnd":88,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/context/remove.go#L60-L88","documentation":"Error \"context %q does not exist\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/context/remove.go:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}