Log when failed to deserialize response from language server (#8046)
This should probably help us debug when language servers don't start up properly. Release Notes: - N/A
This commit is contained in:
@@ -891,8 +891,13 @@ impl LanguageServer {
|
||||
executor
|
||||
.spawn(async move {
|
||||
let response = match result {
|
||||
Ok(response) => serde_json::from_str(&response)
|
||||
.context("failed to deserialize response"),
|
||||
Ok(response) => match serde_json::from_str(&response) {
|
||||
Ok(deserialized) => Ok(deserialized),
|
||||
Err(error) => {
|
||||
log::error!("failed to deserialize response from language server: {}. Response from language server: {:?}", error, response);
|
||||
Err(error).context("failed to deserialize response")
|
||||
}
|
||||
}
|
||||
Err(error) => Err(anyhow!("{}", error.message)),
|
||||
};
|
||||
_ = tx.send(response);
|
||||
|
||||
Reference in New Issue
Block a user