Add better error message for Command failure

This commit is contained in:
Aleksander Vognild Burkow 2018-12-29 22:19:43 +01:00
parent ee9fc3f998
commit 09c20c8fcf

View file

@ -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 {