on master help sign in
DAP: Add request ID to request timeout message (#6018)
ce0837dxiaoma20082008
helix-dap/src/client.rs+1−1
@@ -254,7 +254,7 @@ impl Client {
254 // TODO: specifiable timeout, delay other calls until initialize success
254 // TODO: specifiable timeout, delay other calls until initialize success
255 timeout(Duration::from_secs(20), callback_rx.recv())
255 timeout(Duration::from_secs(20), callback_rx.recv())
256 .await
256 .await
257− .map_err(|_| Error::Timeout)? // return Timeout
257+ .map_err(|_| Error::Timeout(id))? // return Timeout
258 .ok_or(Error::StreamClosed)?
258 .ok_or(Error::StreamClosed)?
259 .map(|response| response.body.unwrap_or_default())
259 .map(|response| response.body.unwrap_or_default())
260 // TODO: check response.success
260 // TODO: check response.success
helix-dap/src/lib.rs+2−2
@@ -14,8 +14,8 @@ pub enum Error {
14 Parse(#[from] serde_json::Error),
14 Parse(#[from] serde_json::Error),
15 #[error("IO Error: {0}")]
15 #[error("IO Error: {0}")]
16 IO(#[from] std::io::Error),
16 IO(#[from] std::io::Error),
17− #[error("request timed out")]
17+ #[error("request {0} timed out")]
18− Timeout,
18+ Timeout(u64),
19 #[error("server closed the stream")]
19 #[error("server closed the stream")]
20 StreamClosed,
20 StreamClosed,
21 #[error(transparent)]
21 #[error(transparent)]