Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/bin/rbw-agent/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,19 @@ impl Agent {
let res =
handle_request(&mut sock, state.clone()).await;
if let Err(e) = res {
// unwrap is the only option here
sock.send(&rbw::protocol::Response::Error {
error: format!("{e:#}"),
})
.await
.unwrap();
// the client may have disconnected already, so
// we can't do anything useful with a send
// failure; just log it instead of panicking
if let Err(send_err) = sock
.send(&rbw::protocol::Response::Error {
error: format!("{e:#}"),
})
.await
{
log::warn!(
"failed to send error response to client: {send_err:#}"
);
}
}
});
}
Expand Down
Loading