More error handling/debugging

This commit is contained in:
Greg Heartsfield 2021-11-23 12:47:02 -06:00
parent 25ac86cc68
commit ba19c978a5

View File

@ -86,6 +86,7 @@ async fn process_client(stream: WebSocketStream<TcpStream>) {
))) )))
.await .await
.expect("send failed"); .expect("send failed");
// Handle this request. Everything else below is basically error handling.
} }
Ok(Message::Binary(_)) => { Ok(Message::Binary(_)) => {
info!("Ignoring Binary message"); info!("Ignoring Binary message");
@ -129,7 +130,8 @@ async fn process_client(stream: WebSocketStream<TcpStream>) {
debug!("Closing this connection normally"); debug!("Closing this connection normally");
return; return;
} }
Err(Tls(_)) | Err(Protocol(_)) | Err(Utf8) | Err(Url(_)) => { Err(Tls(_)) | Err(Protocol(_)) | Err(Utf8) | Err(Url(_)) | Err(HttpFormat(_))
| Err(Http(_)) => {
info!("websocket/tls/enc protocol error, dropping connection"); info!("websocket/tls/enc protocol error, dropping connection");
return; return;
} }