{"id":"1b3a7334f56eee1c","repo":"docker/cli","slug":"docker-w-run-docker-s-help-for-more-inform","errorCode":null,"errorMessage":"docker: %w\n\nRun 'docker %s --help' for more information","messagePattern":"docker: %w\n\nRun 'docker (.+?) --help' for more information","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/container/run.go","lineNumber":319,"sourceCode":"\t\t\t\toutputStream: out,\n\t\t\t\terrorStream:  cerr,\n\t\t\t\tresp:         resp.HijackedResponse,\n\t\t\t\ttty:          config.Tty,\n\t\t\t\tdetachKeys:   options.DetachKeys,\n\t\t\t}\n\n\t\t\tif errHijack := streamer.stream(ctx); errHijack != nil {\n\t\t\t\treturn errHijack\n\t\t\t}\n\t\t\treturn errAttach\n\t\t}()\n\t}()\n\treturn resp.HijackedResponse.Close, nil\n}\n\n// withHelp decorates the error with a suggestion to use \"--help\".\nfunc withHelp(err error, commandName string) error {\n\treturn fmt.Errorf(\"docker: %w\\n\\nRun 'docker %s --help' for more information\", err, commandName)\n}\n\n// toStatusError attempts to detect specific error-conditions to assign\n// an appropriate exit-code for situations where the problem originates\n// from the container. It returns [cli.StatusError] with the original\n// error message and the Status field set as follows:\n//\n// - 125: for generic failures sent back from the daemon\n// - 126: if container start fails with 'permission denied' error\n// - 127: if container start fails with 'not found'/'no such' error\nfunc toStatusError(err error) error {\n\t// TODO(thaJeztah): some of these errors originate from the container: should we actually suggest \"--help\" for those?\n\n\terrMsg := err.Error()\n\n\tif strings.Contains(errMsg, \"executable file not found\") || strings.Contains(errMsg, \"no such file or directory\") || strings.Contains(errMsg, \"system cannot find the file specified\") {\n\t\treturn cli.StatusError{\n\t\t\tCause:      err,","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/container/run.go#L301-L337","documentation":"Error \"docker: %w\n\nRun 'docker %s --help' for more information\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/container/run.go:319 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}