Skip to content

Commit 371a71b

Browse files
0xkr8os0xkr8os
authored andcommitted
fix(rendezvous): log instead of panic when sending response to client
1 parent 2dc453b commit 371a71b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

protocols/rendezvous/src/server.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,14 @@ impl NetworkBehaviour for Behaviour {
189189
handle_request(peer_id, request, &mut self.registrations)
190190
{
191191
if let Some(resp) = response {
192-
self.inner
192+
if let Err(resp) = self.inner
193193
.send_response(channel, resp)
194-
.expect("Send response");
194+
{
195+
tracing::debug!(
196+
%peer_id,
197+
"Failed to send response: {resp:?}"
198+
);
199+
}
195200
}
196201

197202
return Poll::Ready(ToSwarm::GenerateEvent(event));

0 commit comments

Comments
 (0)