mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Add stderr to error message
This commit is contained in:
parent
ecff5dc141
commit
f739e0119c
1 changed files with 6 additions and 1 deletions
|
@ -600,7 +600,12 @@ pub fn get_rustc_cfg_options(target: Option<&String>) -> CfgOptions {
|
||||||
fn output(mut cmd: Command) -> Result<Output> {
|
fn output(mut cmd: Command) -> Result<Output> {
|
||||||
let output = cmd.output().with_context(|| format!("{:?} failed", cmd))?;
|
let output = cmd.output().with_context(|| format!("{:?} failed", cmd))?;
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
bail!("{:?} failed, {}", cmd, output.status)
|
match String::from_utf8(output.stderr) {
|
||||||
|
Ok(stderr) if !stderr.is_empty() => {
|
||||||
|
bail!("{:?} failed, {}\nstderr:\n{}", cmd, output.status, stderr)
|
||||||
|
}
|
||||||
|
_ => bail!("{:?} failed, {}", cmd, output.status),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(output)
|
Ok(output)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue