diff --git a/crates/puffin-cli/src/commands/sync.rs b/crates/puffin-cli/src/commands/sync.rs index 45e270560..9e94c1339 100644 --- a/crates/puffin-cli/src/commands/sync.rs +++ b/crates/puffin-cli/src/commands/sync.rs @@ -1,7 +1,7 @@ use std::fmt::Write; use std::path::Path; -use anyhow::Result; +use anyhow::{Context, Result}; use bitflags::bitflags; use colored::Colorize; use itertools::{Either, Itertools}; @@ -206,7 +206,8 @@ pub(crate) async fn sync( let unzips = unzipper .download(downloads, cache.unwrap_or(staging.path())) - .await?; + .await + .context("Failed to download and unpack wheels")?; let s = if unzips.len() == 1 { "" } else { "s" }; writeln!( diff --git a/crates/puffin-cli/src/main.rs b/crates/puffin-cli/src/main.rs index f6eb5930c..47c22e830 100644 --- a/crates/puffin-cli/src/main.rs +++ b/crates/puffin-cli/src/main.rs @@ -159,7 +159,11 @@ async fn main() -> ExitCode { Err(err) => { #[allow(clippy::print_stderr)] { - eprintln!("{}: {}", "error".red().bold(), err); + let mut causes = err.chain(); + eprintln!("{}: {}", "error".red().bold(), causes.next().unwrap()); + for err in causes { + eprintln!(" {}: {}", "Caused by".red().bold(), err); + } } ExitStatus::Error.into() }