aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-05 11:22:39 +0000
committerAleksey Kladov <[email protected]>2018-11-05 11:22:39 +0000
commit8b132354bb7b08e96bb19b8446f1456c4013e842 (patch)
tree5c2aacef343953c84703fdc826cf15944625e5ba /crates/ra_lsp_server/src
parentde9bb9cfefb6d19958363f7d064aef6adbca9107 (diff)
don't send backtraces for canceled requests
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r--crates/ra_lsp_server/src/main_loop/mod.rs20
1 files changed, 15 insertions, 5 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/mod.rs b/crates/ra_lsp_server/src/main_loop/mod.rs
index 1eb147539..229d1b0f7 100644
--- a/crates/ra_lsp_server/src/main_loop/mod.rs
+++ b/crates/ra_lsp_server/src/main_loop/mod.rs
@@ -376,11 +376,21 @@ impl<'a> PoolDispatcher<'a> {
376 Ok(lsp_error) => { 376 Ok(lsp_error) => {
377 RawResponse::err(id, lsp_error.code, lsp_error.message) 377 RawResponse::err(id, lsp_error.code, lsp_error.message)
378 } 378 }
379 Err(e) => RawResponse::err( 379 Err(e) => {
380 id, 380 if is_canceled(&e) {
381 ErrorCode::InternalError as i32, 381 RawResponse::err(
382 format!("{}\n{}", e, e.backtrace()), 382 id,
383 ), 383 ErrorCode::RequestCancelled as i32,
384 e.to_string(),
385 )
386 } else {
387 RawResponse::err(
388 id,
389 ErrorCode::InternalError as i32,
390 format!("{}\n{}", e, e.backtrace()),
391 )
392 }
393 }
384 }, 394 },
385 }; 395 };
386 let task = Task::Respond(resp); 396 let task = Task::Respond(resp);