{"record":{"id":"691ae9ddeebcb2ae","repo":"rust-lang/rust","slug":"e-error","errorCode":null,"errorMessage":"{e:?}: {error}","messagePattern":"\\{e:\\?\\}: \\{error\\}","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"src/tools/rust-analyzer/crates/rust-analyzer/src/command.rs","lineNumber":117,"sourceCode":"                if let Some(t) = self.parser.from_stderr_line(line, &mut stderr_errors) {\n                    self.sender.send(t).unwrap();\n                    read_at_least_one_stderr_message = true;\n                }\n            },\n            &mut || {\n                if let Some(t) = self.parser.from_eof() {\n                    self.sender.send(t).unwrap();\n                }\n            },\n        );\n\n        let read_at_least_one_message =\n            read_at_least_one_stdout_message || read_at_least_one_stderr_message;\n        let mut error = stdout_errors;\n        error.push_str(&stderr_errors);\n        match output {\n            Ok(_) => Ok((read_at_least_one_message, error)),\n            Err(e) => Err(io::Error::new(e.kind(), format!(\"{e:?}: {error}\"))),\n        }\n    }\n}\n\n/// 'Join On Drop' wrapper for a child process.\n///\n/// This wrapper kills the process when the wrapper is dropped.\nstruct JodGroupChild(Box<dyn ChildWrapper>);\n\nimpl Drop for JodGroupChild {\n    fn drop(&mut self) {\n        _ = self.0.kill();\n        _ = self.0.wait();\n    }\n}\n\n/// A handle to a shell command, such as cargo for diagnostics (flycheck).\npub(crate) struct CommandHandle<T> {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/tools/rust-analyzer/crates/rust-analyzer/src/command.rs#L99-L135","documentation":"Wrapped by rust-analyzer's command runner (output_with_lines) when the underlying process spawning/reading fails. It re-wraps the io::Error preserving its kind and formatting both the debug form of the error and any accumulated stdout/stderr error text. Used for flycheck/cargo diagnostics command execution where partial output may already have been parsed.","triggerScenarios":"rust-analyzer invoking an external command (typically cargo check / clippy) that fails to spawn or exits with an IO error while streaming output - e.g. cargo binary missing, command killed, pipe broken. The error chains the original io::Error kind with the captured parser error buffer.","commonSituations":"cargo or the configured check tool not on PATH; checkOnSave command misconfigured; process killed by OOM or user; antivirus interfering with the spawned tool; disk/pipe errors.","solutions":["Read the {error} portion: it holds captured stdout/stderr lines from the failed command.","Verify the {e:?} portion: if ErrorKind::NotFound, the configured binary is missing - fix checkOnSave.command / PATH.","Run the exact command rust-analyzer logs in a terminal to reproduce the failure directly.","Increase memory/check timeouts if the process is being killed externally."],"exampleFix":"// Configuration fix (settings.json):\n// before\n\"rust-analyzer.check.command\": \"cargo\",\n\"rust-analyzer.check.extraArgs\": [\"--offline\"]\n\n// after - ensure cargo is found and flags are valid\n\"rust-analyzer.check.command\": \"cargo\",\n\"rust-analyzer.check.extraArgs\": []","handlingStrategy":"try-catch","validationCode":"fn tool_available(cmd: &str) -> bool {\n    which::which(cmd).is_ok()\n}\n// Before flycheck: assert tool_available(&check_command).","typeGuard":null,"tryCatchPattern":"match output_with_lines(handle) {\n    Ok((read, errs)) => Ok((read, errs)),\n    Err(e) => {\n        // e.to_string() == \"{e:?}: {error}\"; parse {e:?} for kind\n        if e.kind() == io::ErrorKind::NotFound {\n            // fix checkOnSave.command / PATH, surface to user\n        }\n        Err(e)\n    }\n}","preventionTips":["Validate the check command is on PATH before starting flycheck.","Surface the captured {error} text to the user for actionable diagnostics.","Bound check command runtime/memory to avoid external kills."],"tags":["rust-analyzer","subprocess","io","flycheck","cargo"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}