Skip to content

Commit c7c6444

Browse files
committed
Log unexpected message
1 parent 13e2e29 commit c7c6444

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

crates/ruff_server/src/server/connection.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,20 @@ impl Connection {
103103
tracing::info!("Exit notification received. Server shutting down...");
104104
return Ok(true);
105105
}
106-
lsp::Message::Request(lsp::Request { id, .. }) => {
106+
lsp::Message::Request(lsp::Request { id, method, .. }) => {
107+
tracing::warn!(
108+
"Server received unexpected request {method} ({id}) while waiting for exit notification",
109+
);
107110
self.sender.send(lsp::Message::Response(lsp::Response::new_err(
108111
id.clone(),
109112
lsp::ErrorCode::InvalidRequest as i32,
110113
"Server received unexpected request while waiting for exit notification".to_string(),
111114
)))?;
112115
}
113116
message => {
114-
anyhow::bail!(
115-
"Server received unexpected message {message:?} while waiting for exit notification"
116-
)
117+
tracing::warn!(
118+
"Server received unexpected message while waiting for exit notification: {message:?}"
119+
);
117120
}
118121
}
119122
}

0 commit comments

Comments
 (0)