Skip to content

Commit

Permalink
feat: attach path to fs::read_dir errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanregner committed May 19, 2024
1 parent a6b879d commit 2c4920e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/repos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ pub fn find_repos(
}
repos.insert_repo(name, repo);
} else if file.path.is_dir() && file.depth > 0 {
let read_dir = fs::read_dir(file.path)
.change_context(TmsError::IoError)?
let read_dir = fs::read_dir(&file.path)
.change_context(TmsError::IoError)
.attach_printable_lazy(|| format!("Could not read directory {:?}", file.path))?
.map(|dir_entry| dir_entry.expect("Found non-valid utf8 path").path());
for dir in read_dir {
to_search.push_back(SearchDirectory::new(dir, file.depth - 1))
Expand Down

0 comments on commit 2c4920e

Please sign in to comment.