aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2025-03-24 11:42:20 +0100
committerHimbeer <himbeer@disroot.org>2025-03-24 11:42:20 +0100
commit6c3c336c0efbeda3c3c0df972dd082d06a8e8774 (patch)
tree939f25b0f018e8c4fa9ce95849287933a1bb7603
parent5d17dc90fc9388e52ea35875ba78a84cfb7d77d1 (diff)
Catch inbound request handling errors gracefully
-rw-r--r--src/main.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 768ec75..439d8dc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -70,7 +70,10 @@ fn check_rollback(ln: &TcpListener) -> io::Result<()> {
let mut t = t_start;
loop {
match ln.accept() {
- Ok((conn, raddr)) => handle_conn_check(conn, raddr, &mut inbound_healthy)?,
+ Ok((conn, raddr)) => match handle_conn_check(conn, raddr, &mut inbound_healthy) {
+ Ok(_) => {}
+ Err(e) => eprintln!("[warn] handle (rollback) {}: {}", raddr, e),
+ },
Err(e) if e.kind() == io::ErrorKind::WouldBlock => {}
Err(e) => return Err(e),
}
@@ -100,7 +103,10 @@ fn monitor(ln: &TcpListener) -> io::Result<()> {
let mut t = t_healthy;
loop {
match ln.accept() {
- Ok((conn, raddr)) => handle_conn_monitor(conn, raddr)?,
+ Ok((conn, raddr)) => match handle_conn_monitor(conn, raddr) {
+ Ok(_) => {}
+ Err(e) => eprintln!("[warn] handle (monitor) {}: {}", raddr, e),
+ },
Err(e) if e.kind() == io::ErrorKind::WouldBlock => {}
Err(e) => return Err(e),
}