mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-22 16:11:38 +03:00
net: more useful debug logs
This commit is contained in:
parent
9db2ad638d
commit
b4e9ffa145
@ -100,7 +100,18 @@ pub async fn init_direct(
|
||||
));
|
||||
Ok(())
|
||||
}
|
||||
_ => return Err(peer_rx),
|
||||
Ok(Err(e)) => {
|
||||
print_debug(
|
||||
&ext.print_tx,
|
||||
&format!("net: error in tcp::init_direct: {e}"),
|
||||
)
|
||||
.await;
|
||||
return Err(peer_rx);
|
||||
}
|
||||
Err(_) => {
|
||||
print_debug(&ext.print_tx, "net: tcp::init_direct timed out").await;
|
||||
return Err(peer_rx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,18 @@ pub async fn init_direct(
|
||||
));
|
||||
Ok(())
|
||||
}
|
||||
_ => return Err(peer_rx),
|
||||
Ok(Err(e)) => {
|
||||
print_debug(
|
||||
&ext.print_tx,
|
||||
&format!("net: error in ws::init_direct: {e}"),
|
||||
)
|
||||
.await;
|
||||
return Err(peer_rx);
|
||||
}
|
||||
Err(_) => {
|
||||
print_debug(&ext.print_tx, "net: ws::init_direct timed out").await;
|
||||
return Err(peer_rx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ pub async fn recv(socket: &mut WebSocket) -> anyhow::Result<Vec<u8>> {
|
||||
}
|
||||
Some(Ok(tungstenite::Message::Pong(_))) => continue,
|
||||
Some(Ok(tungstenite::Message::Binary(bin))) => return Ok(bin),
|
||||
_ => return Err(anyhow::anyhow!("websocket closed")),
|
||||
_ => return Err(anyhow::anyhow!("invalid websocket message received")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user