From 60438bac5c6b13e76a984b9a2c8b7290420615a5 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Tue, 7 Dec 2021 21:08:51 +0000 Subject: [PATCH] Be more informative about missing binaries --- src/tool/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tool/mod.rs b/src/tool/mod.rs index 3841cee..2828c6b 100644 --- a/src/tool/mod.rs +++ b/src/tool/mod.rs @@ -2,6 +2,7 @@ mod chroot; mod mount; mod qemu; +use anyhow::Context; pub use chroot::chroot; pub use mount::mount; pub use qemu::qemu; @@ -17,7 +18,9 @@ pub struct Tool { impl Tool { pub fn find(name: &'static str) -> anyhow::Result { - Ok(Self { exec: which(name)? }) + Ok(Self { + exec: which(name).context(format!("Cannot find {}", name))?, + }) } pub fn execute(&self) -> Command {