Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Improve error messages when fetching single GitHub release (#9219)
Thorsten Ball9f396948bb18
diff --git a/crates/util/src/github.rs b/crates/util/src/github.rsindex 7e2578214e6..76891e1bd17 100644--- a/crates/util/src/github.rs+++ b/crates/util/src/github.rs@@ -85,14 +85,19 @@ pub async fn github_release_with_tag(let mut response = http.get(&url, Default::default(), true).await- .context("error fetching latest release")?;+ .with_context(|| format!("error fetching release {} of {}", tag, repo_name_with_owner))?;let mut body = Vec::new();response.body_mut().read_to_end(&mut body).await- .context("error reading latest release")?;+ .with_context(|| {+ format!(+ "error reading response body for release {} of {}",+ tag, repo_name_with_owner+ )+ })?;if response.status().is_client_error() {let text = String::from_utf8_lossy(body.as_slice());@@ -111,7 +116,11 @@ pub async fn github_release_with_tag("GitHub API response text: {:?}",String::from_utf8_lossy(body.as_slice()));- return Err(anyhow!("error deserializing latest release"));+ Err(anyhow!(+ "error deserializing release {} of {}",+ tag,+ repo_name_with_owner+ ))}}}