feat: optimize error processing
This commit is contained in:
@@ -242,7 +242,7 @@ async fn inner_handle_connection(
|
|||||||
) -> XResult<()> {
|
) -> XResult<()> {
|
||||||
information!("Incoming TCP connection from: {}", addr);
|
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);
|
information!("WebSocket connection established: {}", addr);
|
||||||
|
|
||||||
// Insert the write part of this peer to the peer map.
|
// Insert the write part of this peer to the peer map.
|
||||||
|
|||||||
Reference in New Issue
Block a user