From 38957ac9495519df43800d2a55e56b65e4ced783 Mon Sep 17 00:00:00 2001 From: Scott Opell Date: Tue, 5 Mar 2024 22:29:30 +0000 Subject: [PATCH] Adds the specific path that caused a failure --- lading/src/common.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lading/src/common.rs b/lading/src/common.rs index 79314649c..b8a16de8a 100644 --- a/lading/src/common.rs +++ b/lading/src/common.rs @@ -56,7 +56,12 @@ pub(crate) fn stdio(behavior: &Behavior) -> Stdio { match behavior { Behavior::Quiet => Stdio::null(), Behavior::Log(path) => { - let fp = fs::File::create(path).expect("Full directory path does not exist"); + let fp = fs::File::create(path).unwrap_or_else(|_| { + panic!( + "Full directory path does not exist: {path}", + path = path.display() + ); + }); Stdio::from(fp) } }