Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
feat: log send to client error
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi authored and dirvine committed Jan 26, 2021
1 parent 27b373c commit ddeff5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/routing/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ impl Comm {
msg: Bytes,
) -> Result<(), SendError> {
if let Some(conn) = self.endpoint.get_connection(client) {
if conn.send_uni(msg.clone()).await.is_ok() {
if let Err(err) = conn.send_uni(msg.clone()).await {
error!(
"Sending message to client {:?} failed with error {:?}",
client, err
);
} else {
return Ok(());
}
}
Expand Down
1 change: 1 addition & 0 deletions src/routing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ async fn handle_connection_events(
stage.send_event(event).await;
}
ConnectionEvent::Disconnected(addr) => {
trace!("Lost connection to {:?}", addr);
let _ = stage
.clone()
.handle_commands(Command::HandleConnectionLost(addr))
Expand Down

0 comments on commit ddeff5e

Please sign in to comment.