Skip to content

Commit f739e01

Browse files
committed
Add stderr to error message
1 parent ecff5dc commit f739e01

File tree

1 file changed

+6
-1
lines changed
  • crates/ra_project_model/src

1 file changed

+6
-1
lines changed

crates/ra_project_model/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,12 @@ pub fn get_rustc_cfg_options(target: Option<&String>) -> CfgOptions {
600600
fn output(mut cmd: Command) -> Result<Output> {
601601
let output = cmd.output().with_context(|| format!("{:?} failed", cmd))?;
602602
if !output.status.success() {
603-
bail!("{:?} failed, {}", cmd, output.status)
603+
match String::from_utf8(output.stderr) {
604+
Ok(stderr) if !stderr.is_empty() => {
605+
bail!("{:?} failed, {}\nstderr:\n{}", cmd, output.status, stderr)
606+
}
607+
_ => bail!("{:?} failed, {}", cmd, output.status),
608+
}
604609
}
605610
Ok(output)
606611
}

0 commit comments

Comments
 (0)