feat: optimize error processing

This commit is contained in:
2023-11-05 00:48:03 +08:00
parent f24260b1a3
commit cbbe2ded58

View File

@@ -242,7 +242,7 @@ async fn inner_handle_connection(
) -> XResult<()> {
information!("Incoming TCP connection from: {}", addr);
let ws_stream = tokio_tungstenite::accept_async(raw_stream).await?;
let ws_stream = opt_result!(tokio_tungstenite::accept_async(raw_stream).await, "Accept websocket failed: {}");
information!("WebSocket connection established: {}", addr);
// Insert the write part of this peer to the peer map.