Fix error message when connection's IO loop exits before message loop

This commit is contained in:
Max Brunsfeld 2021-07-13 13:00:10 -07:00
parent 561cabbba2
commit 42ba24c5a8

View file

@ -227,7 +227,8 @@ impl Peer {
connection connection
.outgoing_tx .outgoing_tx
.send(request.into_envelope(message_id, None, original_sender_id.map(|id| id.0))) .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 let response = rx
.recv() .recv()
.await .await