Skip to content

Commit 05a8062

Browse files
authored
When spawn() fails, include the underlying error in the message. (#613)
Include spawn()'s error message when reporting a spawn error, as it may contain information useful for determining the cause of the error. This is motivated by the CI error messages in rust-lang/rust#87329.
1 parent 4a6e8b7 commit 05a8062

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -3041,9 +3041,12 @@ fn spawn(cmd: &mut Command, program: &str) -> Result<(Child, JoinHandle<()>), Er
30413041
&format!("Failed to find tool. Is `{}` installed?{}", program, extra),
30423042
))
30433043
}
3044-
Err(_) => Err(Error::new(
3044+
Err(ref e) => Err(Error::new(
30453045
ErrorKind::ToolExecError,
3046-
&format!("Command {:?} with args {:?} failed to start.", cmd, program),
3046+
&format!(
3047+
"Command {:?} with args {:?} failed to start: {:?}",
3048+
cmd, program, e
3049+
),
30473050
)),
30483051
}
30493052
}

0 commit comments

Comments
 (0)