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();