From 6e919da38af0b84d9bd5ee01d610167cc6ab365c Mon Sep 17 00:00:00 2001 From: Tim de Jager Date: Thu, 15 Feb 2024 10:56:25 +0100 Subject: [PATCH] fix: print packagedb error during wheel build (#220) Print the potential error from PackageDB during a wheel build. --- .../src/wheel_builder/build_environment.rs | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/crates/rattler_installs_packages/src/wheel_builder/build_environment.rs b/crates/rattler_installs_packages/src/wheel_builder/build_environment.rs index 8a1068fb..28503e97 100644 --- a/crates/rattler_installs_packages/src/wheel_builder/build_environment.rs +++ b/crates/rattler_installs_packages/src/wheel_builder/build_environment.rs @@ -257,19 +257,24 @@ impl BuildEnvironment { package_info.version ); let artifact_info = package_info.artifacts.first().unwrap(); - let (artifact, direct_url_json) = wheel_builder + let result = wheel_builder .package_db .get_wheel(artifact_info, Some(wheel_builder)) - .await - .expect("could not get artifact"); - - self.venv.install_wheel( - &artifact, - &UnpackWheelOptions { - direct_url_json, - ..Default::default() - }, - )?; + .await; + match result { + Ok((wheel, direct_url_json)) => { + self.venv.install_wheel( + &wheel, + &UnpackWheelOptions { + direct_url_json, + ..Default::default() + }, + )?; + } + Err(e) => { + panic!("could not get artifact: {}", e) + } + } } } Ok(())