From 09c20c8fcfa555465d367d4c09ac9f89259d5cf5 Mon Sep 17 00:00:00 2001 From: Aleksander Vognild Burkow Date: Sat, 29 Dec 2018 22:19:43 +0100 Subject: Add better error message for Command failure --- crates/ra_lsp_server/src/main_loop/handlers.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/ra_lsp_server/src') 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( 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 { -- cgit v1.2.3