From 6bcabcbb6b50e2e523982b626d3003e95ffedb73 Mon Sep 17 00:00:00 2001 From: Kousuke Takaki Date: Mon, 14 Dec 2020 16:11:01 +0900 Subject: [PATCH] Improve error message --- src/utils/fs.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/fs.rs b/src/utils/fs.rs index dd1ec218..1c80abbb 100644 --- a/src/utils/fs.rs +++ b/src/utils/fs.rs @@ -110,7 +110,10 @@ pub fn copy_files_except_ext( for entry in fs::read_dir(from)? { let entry = entry?; - let metadata = entry.path().metadata()?; + let metadata = entry + .path() + .metadata() + .with_context(|| format!("Failed to read {:?}", entry.path()))?; // If the entry is a dir and the recursive option is enabled, call itself if metadata.is_dir() && recursive {