From 1c02e380fbd54a0c6ffa97fb165d245c3686bc9d Mon Sep 17 00:00:00 2001 From: Yi LIU Date: Thu, 12 Feb 2026 20:13:54 +0800 Subject: [PATCH] Handle JoinError in registry download task results The unwrap() on the JoinResult from spawned download tasks would panic if a task panicked or was cancelled. Now maps the JoinError to a proper RegistryDownloadFailure error variant instead. --- crates/wac-resolver/src/registry.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/wac-resolver/src/registry.rs b/crates/wac-resolver/src/registry.rs index 8169497..53a5eec 100644 --- a/crates/wac-resolver/src/registry.rs +++ b/crates/wac-resolver/src/registry.rs @@ -153,7 +153,9 @@ impl RegistryPackageResolver { let mut finished = 0; while let Some(res) = tasks.next().await { - let (index, download) = res.unwrap()?; + let (index, download) = res.map_err(|e| Error::RegistryDownloadFailure { + source: anyhow::anyhow!("download task panicked: {e}"), + })??; finished += 1;