Merge pull request #1399 from u7693/issue-1396

Show path in the error message (#1396)
This commit is contained in:
Eric Huss 2020-12-14 08:08:05 -08:00 committed by GitHub
commit 45a481049e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,7 +110,10 @@ pub fn copy_files_except_ext(
for entry in fs::read_dir(from)? { for entry in fs::read_dir(from)? {
let entry = entry?; 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 the entry is a dir and the recursive option is enabled, call itself
if metadata.is_dir() && recursive { if metadata.is_dir() && recursive {