diff --git a/zed/src/rpc.rs b/zed/src/rpc.rs index aa212a804222f73b9dc48d6629a3b94118c6b978..a5679f7747a9baabca98858d095b357fe30e4000 100644 --- a/zed/src/rpc.rs +++ b/zed/src/rpc.rs @@ -113,7 +113,13 @@ impl Client { async_tungstenite::client_async(format!("wss://{}/rpc", host), stream).await?; log::info!("connected to rpc address {}", &*ZED_SERVER_URL); let (connection_id, handler) = self.peer.add_connection(stream).await; - executor.spawn(handler.run()).detach(); + executor + .spawn(async move { + if let Err(error) = handler.run().await { + log::error!("connection error: {:?}", error); + } + }) + .detach(); connection_id } else if let Some(host) = server_url.strip_prefix("http://") { let stream = smol::net::TcpStream::connect(host).await?; @@ -121,7 +127,13 @@ impl Client { async_tungstenite::client_async(format!("ws://{}/rpc", host), stream).await?; log::info!("connected to rpc address {}", &*ZED_SERVER_URL); let (connection_id, handler) = self.peer.add_connection(stream).await; - executor.spawn(handler.run()).detach(); + executor + .spawn(async move { + if let Err(error) = handler.run().await { + log::error!("connection error: {:?}", error); + } + }) + .detach(); connection_id } else { return Err(anyhow!("invalid server url: {}", server_url))?; diff --git a/zed/src/workspace.rs b/zed/src/workspace.rs index 6be96dc49cf6d54f3d1c497257373e28b5486c92..53990fe95e2f56b3363f5703c5009a0792f9c2ee 100644 --- a/zed/src/workspace.rs +++ b/zed/src/workspace.rs @@ -705,7 +705,7 @@ impl Workspace { cx.spawn(|_, _| async move { if let Err(e) = task.await { - log::error!("sharing failed: {}", e); + log::error!("sharing failed: {:?}", e); } }) .detach();