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 captured_stdout = String::from_utf8(output.stdout)?;
|
||||
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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue