aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server
diff options
context:
space:
mode:
authorAleksander Vognild Burkow <[email protected]>2018-12-29 21:19:43 +0000
committerAleksander Vognild Burkow <[email protected]>2018-12-29 22:38:26 +0000
commit09c20c8fcfa555465d367d4c09ac9f89259d5cf5 (patch)
tree0373239e3b99c045537e4775488b2a8a8edb2482 /crates/ra_lsp_server
parentee9fc3f99884e973283f987cf56876e2db334628 (diff)
Add better error message for Command failure
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index 07579be12..ecfa42206 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -625,7 +625,10 @@ pub fn handle_formatting(
625 let output = rustfmt.wait_with_output()?; 625 let output = rustfmt.wait_with_output()?;
626 let captured_stdout = String::from_utf8(output.stdout)?; 626 let captured_stdout = String::from_utf8(output.stdout)?;
627 if !output.status.success() { 627 if !output.status.success() {
628 return Err(failure::err_msg(captured_stdout)); 628 return Err(failure::err_msg(format!(
629 "rustfmt exited with error code {}: {}.",
630 output.status, captured_stdout
631 )));
629 } 632 }
630 633
631 Ok(Some(vec![TextEdit { 634 Ok(Some(vec![TextEdit {