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 ...
This commit is contained in:
Lukas Wirth
2025-11-06 11:00:41 +00:00
committed by GitHub
parent f6da987d4c
commit 28d7c37b0d
4 changed files with 11 additions and 8 deletions
@@ -482,12 +482,14 @@ impl remote::RemoteClientDelegate for RemoteClientDelegate {
version: Option<SemanticVersion>,
cx: &mut AsyncApp,
) -> Task<anyhow::Result<PathBuf>> {
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,
)