From 2f8be74f2b81e3d1cd5099aab7e4fa1208f07bf5 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 15 Oct 2023 22:06:15 +0300 Subject: [PATCH] Mention file paths in errors when deailng with assets --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index a74a878..310f01c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -311,9 +311,11 @@ impl Build { let dst_path = dest_dir.join(asset); info!("copy {:?} to {:?}", src_path, dst_path); if let Some(dst_parent) = dst_path.parent() { - fs::create_dir_all(&dst_parent)?; + fs::create_dir_all(&dst_parent) + .with_context(|| format!("creating {dst_parent:?}"))?; } - fs::copy(&src_path, &dst_path)?; + fs::copy(&src_path, &dst_path) + .with_context(|| format!("copying from {src_path:?} to {dst_path:?}"))?; } } Ok(())