From 28d7c37b0d43ec1f679f9ef6a33d215b912c3f4a Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 6 Nov 2025 12:00:41 +0100 Subject: [PATCH] recent_projects: Improve user facing error messages on connection failure (#42083) cc https://github.com/zed-industries/zed/issues/42004 Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/auto_update/src/auto_update.rs | 3 +++ crates/markdown/src/markdown.rs | 2 +- crates/recent_projects/src/remote_connections.rs | 10 ++++++---- crates/remote/src/transport/wsl.rs | 4 +--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rs index c727a94c2d5718d42d29a3158552836868a4ace5..561f4f3ea3749a6d6146714372df0c33f3e3e877 100644 --- a/crates/auto_update/src/auto_update.rs +++ b/crates/auto_update/src/auto_update.rs @@ -406,6 +406,7 @@ impl AutoUpdater { arch: &str, release_channel: ReleaseChannel, version: Option, + set_status: impl Fn(&str, &mut AsyncApp) + Send + 'static, cx: &mut AsyncApp, ) -> Result { let this = cx.update(|cx| { @@ -415,6 +416,7 @@ impl AutoUpdater { .context("auto-update not initialized") })??; + set_status("Fetching remote server release", cx); let release = Self::get_release( &this, "zed-remote-server", @@ -439,6 +441,7 @@ impl AutoUpdater { "downloading zed-remote-server {os} {arch} version {}", release.version ); + set_status("Downloading remote server", cx); download_remote_server_binary(&version_path, release, client, cx).await?; } diff --git a/crates/markdown/src/markdown.rs b/crates/markdown/src/markdown.rs index c34ed69288e39c26d105877d76ee76c01c864c72..4f714b9b451a54a4a01099922763ece5df2f6b8a 100644 --- a/crates/markdown/src/markdown.rs +++ b/crates/markdown/src/markdown.rs @@ -1215,7 +1215,7 @@ impl Element for MarkdownElement { } MarkdownEvent::SoftBreak => builder.push_text(" ", range.clone()), MarkdownEvent::HardBreak => builder.push_text("\n", range.clone()), - _ => log::error!("unsupported markdown event {:?}", event), + _ => log::debug!("unsupported markdown event {:?}", event), } } let mut rendered_markdown = builder.build(); diff --git a/crates/recent_projects/src/remote_connections.rs b/crates/recent_projects/src/remote_connections.rs index 54d87350ff368935d56f979cd260a925e7614a6d..82fa72723286a1a3497ed0baebdb5db830a50b99 100644 --- a/crates/recent_projects/src/remote_connections.rs +++ b/crates/recent_projects/src/remote_connections.rs @@ -482,12 +482,14 @@ impl remote::RemoteClientDelegate for RemoteClientDelegate { version: Option, cx: &mut AsyncApp, ) -> Task> { + let this = self.clone(); cx.spawn(async move |cx| { AutoUpdater::download_remote_server_release( platform.os, platform.arch, release_channel, version, + move |status, cx| this.set_status(Some(status), cx), cx, ) .await @@ -659,7 +661,7 @@ pub async fn open_remote_project( } }) .ok(); - log::error!("Failed to open project: {e:?}"); + log::error!("Failed to open project: {e:#}"); let response = window .update(cx, |_, window, cx| { window.prompt( @@ -668,7 +670,7 @@ pub async fn open_remote_project( RemoteConnectionOptions::Ssh(_) => "Failed to connect over SSH", RemoteConnectionOptions::Wsl(_) => "Failed to connect to WSL", }, - Some(&e.to_string()), + Some(&format!("{e:#}")), &["Retry", "Cancel"], cx, ) @@ -715,7 +717,7 @@ pub async fn open_remote_project( match opened_items { Err(e) => { - log::error!("Failed to open project: {e:?}"); + log::error!("Failed to open project: {e:#}"); let response = window .update(cx, |_, window, cx| { window.prompt( @@ -724,7 +726,7 @@ pub async fn open_remote_project( RemoteConnectionOptions::Ssh(_) => "Failed to connect over SSH", RemoteConnectionOptions::Wsl(_) => "Failed to connect to WSL", }, - Some(&e.to_string()), + Some(&format!("{e:#}")), &["Retry", "Cancel"], cx, ) diff --git a/crates/remote/src/transport/wsl.rs b/crates/remote/src/transport/wsl.rs index 1bfa5e640d991f939456418750b633d87cbde3f6..d91a0d742cd711148ca81f583e982b3836508a57 100644 --- a/crates/remote/src/transport/wsl.rs +++ b/crates/remote/src/transport/wsl.rs @@ -210,8 +210,6 @@ impl WslRemoteConnection { return Ok(dst_path); } - delegate.set_status(Some("Installing remote server"), cx); - let wanted_version = match release_channel { ReleaseChannel::Nightly | ReleaseChannel::Dev => None, _ => Some(cx.update(|cx| AppVersion::global(cx))?), @@ -242,7 +240,7 @@ impl WslRemoteConnection { delegate: &Arc, cx: &mut AsyncApp, ) -> Result<()> { - delegate.set_status(Some("Uploading remote server to WSL"), cx); + delegate.set_status(Some("Uploading remote server"), cx); if let Some(parent) = dst_path.parent() { let parent = parent.display(PathStyle::Posix);