Skip to content

Commit

Permalink
src: lib: drivers: udp: Fix verbosity of UDP send errors
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Oct 24, 2024
1 parent eb7ca2b commit 9c6b949
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib/drivers/udp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,16 @@ where
}
}

if let Err(error) = writer.send(((**message).clone(), *remote_addr)).await {
error!(client = ?remote_addr, "Failed to send message: {error:?}");
if let Err(io_error) = writer.send(((**message).clone(), *remote_addr)).await {
match io_error.kind() {
std::io::ErrorKind::ConnectionRefused => {
trace!(client = ?remote_addr, "Failed send message: {io_error}");
continue;
}
_ => {
error!(client = ?remote_addr, "Failed to send message: {io_error:?}");
}
}
break;
}

Expand Down

0 comments on commit 9c6b949

Please sign in to comment.