Unnamed repository; edit this file 'description' to name the repository.
Don't panic on invalid notifications
| -rw-r--r-- | crates/rust-analyzer/src/handlers/dispatch.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/handlers/dispatch.rs b/crates/rust-analyzer/src/handlers/dispatch.rs index 90deae2d90..67bd643fce 100644 --- a/crates/rust-analyzer/src/handlers/dispatch.rs +++ b/crates/rust-analyzer/src/handlers/dispatch.rs @@ -414,7 +414,8 @@ impl NotificationDispatcher<'_> { let params = match not.extract::<N::Params>(N::METHOD) { Ok(it) => it, Err(ExtractError::JsonError { method, error }) => { - panic!("Invalid request\nMethod: {method}\n error: {error}",) + tracing::error!(method = %method, error = %error, "invalid notification"); + return self; } Err(ExtractError::MethodMismatch(not)) => { self.not = Some(not); |