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:
parent
4616d66e1d
commit
fc101c1fb3
1 changed files with 7 additions and 2 deletions
|
@ -891,8 +891,13 @@ impl LanguageServer {
|
||||||
executor
|
executor
|
||||||
.spawn(async move {
|
.spawn(async move {
|
||||||
let response = match result {
|
let response = match result {
|
||||||
Ok(response) => serde_json::from_str(&response)
|
Ok(response) => match serde_json::from_str(&response) {
|
||||||
.context("failed to deserialize 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)),
|
Err(error) => Err(anyhow!("{}", error.message)),
|
||||||
};
|
};
|
||||||
_ = tx.send(response);
|
_ = tx.send(response);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue