From 1227a935a251626d856a79981871fef8847d7b92 Mon Sep 17 00:00:00 2001 From: Winter Hille Date: Thu, 21 Nov 2024 04:17:57 -0800 Subject: [PATCH] temporary fix for poison error --- src/server.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server.rs b/src/server.rs index 7ee39ff..a7f3cfd 100644 --- a/src/server.rs +++ b/src/server.rs @@ -44,7 +44,10 @@ impl Server { if bytes_read > 0 { if let Ok(request_str) = from_utf8(&buffer[..bytes_read]) { - if let Some(on_request) = &*on_request.lock().unwrap() { + // TODO: support proper error handling + if let Some(on_request) = + &*on_request.lock().unwrap_or_else(|e| e.into_inner()) + { let request; { let mut lines = request_str.lines();