diff options
Diffstat (limited to 'src/conn.rs')
-rw-r--r-- | src/conn.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conn.rs b/src/conn.rs index 7f869e8..d4362e5 100644 --- a/src/conn.rs +++ b/src/conn.rs @@ -216,7 +216,9 @@ impl ClientConn { if let Some((id, resp)) = resp { trace!("dispatch_resp: got resp to {}, {} bytes", id, resp.len()); if let Some(ch) = resp_notify.remove(&id) { - ch.send(resp).map_err(|_| Error::Message("Could not dispatch reply".to_string()))?; + if ch.send(resp).is_err() { + debug!("Could not dispatch reply (channel probably closed, happens if request was canceled)"); + } } else { resps.insert(id, resp); } @@ -226,7 +228,9 @@ impl ClientConn { if let Some((id, resp_ch)) = resp_ch { trace!("dispatch_resp: got resp_ch {}", id); if let Some(rs) = resps.remove(&id) { - resp_ch.send(rs).map_err(|_| Error::Message("Could not dispatch reply".to_string()))?; + if resp_ch.send(rs).is_err() { + debug!("Could not dispatch reply (channel probably closed, happens if request was canceled)"); + } } else { resp_notify.insert(id, resp_ch); } |