Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-dap/src/transport.rs')
| -rw-r--r-- | helix-dap/src/transport.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/helix-dap/src/transport.rs b/helix-dap/src/transport.rs index fdd60226..8ca408df 100644 --- a/helix-dap/src/transport.rs +++ b/helix-dap/src/transport.rs @@ -125,14 +125,12 @@ impl Transport { info!("[{}] <- DAP {}", id, msg); - // NOTE: We avoid using `?` here, since it would return early on error - // and skip clearing `content`. By returning the result directly instead, - // we ensure `content.clear()` is always called. - let output = sonic_rs::from_slice(content).map_err(Into::into); + // try parsing as output (server response) or call (server request) + let output: serde_json::Result<Payload> = serde_json::from_str(msg); content.clear(); - output + Ok(output?) } async fn recv_server_error( |