From 795f4f1977f2b82e16ef11c5a2df8f8f79642e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Walski?= Date: Wed, 17 Apr 2024 19:05:42 +0200 Subject: [PATCH] Verbose console error msg --- src/process.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/process.rs b/src/process.rs index aaf34b5..bb36544 100644 --- a/src/process.rs +++ b/src/process.rs @@ -44,14 +44,17 @@ pub(crate) trait Runtime: Sized { async fn wait(&mut self) -> std::io::Result; fn test(config: &Self::CONFIG) -> anyhow::Result<()> { - gpu_detection(config).context("Testing runtime failed. Unable to detect GPU.")?; + gpu_detection(config).map_err(|err| { + anyhow::anyhow!("Testing runtime failed. Unable to detect GPU. Error: {err}") + })?; Ok(()) } fn offer_template(config: &Self::CONFIG) -> anyhow::Result { let mut template = offer_template::template(config)?; - let gpu = gpu_detection(config) - .context("Generating offer template failed. Unable to detect GPU.")?; + let gpu = gpu_detection(config).map_err(|err| { + anyhow::anyhow!("Generating offer template failed. Unable to detect GPU. Error: {err}") + })?; let gpu = serde_json::value::to_value(gpu)?; template.set_property("golem.!exp.gap-35.v1.inf.gpu", gpu); Ok(template)