From 42ba24c5a81e0024921fa08af15fb90ff2c3e237 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 13 Jul 2021 13:00:10 -0700 Subject: [PATCH] Fix error message when connection's IO loop exits before message loop --- zrpc/src/peer.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zrpc/src/peer.rs b/zrpc/src/peer.rs index 5580fc628a..2093d6a732 100644 --- a/zrpc/src/peer.rs +++ b/zrpc/src/peer.rs @@ -227,7 +227,8 @@ impl Peer { connection .outgoing_tx .send(request.into_envelope(message_id, None, original_sender_id.map(|id| id.0))) - .await?; + .await + .map_err(|_| anyhow!("connection was closed"))?; let response = rx .recv() .await