diff options
Diffstat (limited to 'jsonrpc/src')
-rw-r--r-- | jsonrpc/src/server/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/jsonrpc/src/server/mod.rs b/jsonrpc/src/server/mod.rs index 50a4a8e..ed027f5 100644 --- a/jsonrpc/src/server/mod.rs +++ b/jsonrpc/src/server/mod.rs @@ -113,8 +113,8 @@ impl Server { /// Handles a new connection async fn handle_conn(self: &Arc<Self>, conn: Conn<serde_json::Value>) -> Result<()> { - let endpoint = conn.peer_endpoint().expect("get peer endpoint"); - debug!("Handle a new connection {endpoint}"); + let endpoint: Option<Endpoint> = conn.peer_endpoint().ok(); + debug!("Handle a new connection {:?}", endpoint); let conn = Arc::new(conn); @@ -171,9 +171,9 @@ impl Server { let chan = channel.clone(); let on_complete = |result: TaskResult<Result<()>>| async move { if let TaskResult::Completed(Err(err)) = result { - error!("Connection {} dropped: {}", endpoint, err); + error!("Connection {:?} dropped: {err}", endpoint); } else { - warn!("Connection {} dropped", endpoint); + warn!("Connection {:?} dropped", endpoint); } // Close the connection channel when the connection dropped chan.close(); |