mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Add better error message for Command failure
This commit is contained in:
parent
ee9fc3f998
commit
09c20c8fcf
1 changed files with 4 additions and 1 deletions
|
@ -625,7 +625,10 @@ pub fn handle_formatting(
|
||||||
let output = rustfmt.wait_with_output()?;
|
let output = rustfmt.wait_with_output()?;
|
||||||
let captured_stdout = String::from_utf8(output.stdout)?;
|
let captured_stdout = String::from_utf8(output.stdout)?;
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
return Err(failure::err_msg(captured_stdout));
|
return Err(failure::err_msg(format!(
|
||||||
|
"rustfmt exited with error code {}: {}.",
|
||||||
|
output.status, captured_stdout
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Some(vec![TextEdit {
|
Ok(Some(vec![TextEdit {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue