mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
DAP: Add request ID to request timeout message (#6018)
This improves error logging for dap requests. Without the ID it's hard to know which request is the one that timed out.
This commit is contained in:
parent
78a1e2db60
commit
ce0837dbb7
@ -254,7 +254,7 @@ pub fn call<R: crate::types::Request>(
|
||||
// TODO: specifiable timeout, delay other calls until initialize success
|
||||
timeout(Duration::from_secs(20), callback_rx.recv())
|
||||
.await
|
||||
.map_err(|_| Error::Timeout)? // return Timeout
|
||||
.map_err(|_| Error::Timeout(id))? // return Timeout
|
||||
.ok_or(Error::StreamClosed)?
|
||||
.map(|response| response.body.unwrap_or_default())
|
||||
// TODO: check response.success
|
||||
|
@ -14,8 +14,8 @@ pub enum Error {
|
||||
Parse(#[from] serde_json::Error),
|
||||
#[error("IO Error: {0}")]
|
||||
IO(#[from] std::io::Error),
|
||||
#[error("request timed out")]
|
||||
Timeout,
|
||||
#[error("request {0} timed out")]
|
||||
Timeout(u64),
|
||||
#[error("server closed the stream")]
|
||||
StreamClosed,
|
||||
#[error(transparent)]
|
||||
|
Loading…
Reference in New Issue
Block a user