Propagate per-entry errors from Path.list!
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 121
- Forks
- 45
- Avg merge
- 18h 43m
- Merged PRs (30d)
- 10
Description
Context
hosted_dir_list currently discards errors produced while iterating an otherwise successfully opened directory:
let entries = read_dir
.filter_map(|entry| entry.ok().map(|entry| entry.path()))
.collect();
See src/lib.rs:1173-1177.
This can return an incomplete list as Ok when an entry disappears during iteration or the filesystem reports an I/O error. Because Path.list! already returns a Try, silently returning partial data is surprising and can lead applications to make incorrect decisions.
Suggested direction
Collect the iterator as a Result<Vec<_>, io::Error> and map the first entry error through the existing directory error conversion. If partial results are considered useful, expose them through a deliberately different API and result type.
Acceptance criteria
- An error from any
ReadDirentry is not silently dropped. Path.list!returns either a complete snapshot-like result or a typed error.- Tests exercise the error branch through a controllable abstraction or filesystem race harness.
- Existing success and non-directory cases continue to pass on Unix and Windows.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/lib.rs:1173-1177 and inspect hosted_dir_list, the existing directory error conversion, and the Path.list! entry point. Add coverage for an error from a ReadDir entry using a controllable abstraction or filesystem race harness, while preserving success and non-directory behavior on Unix and Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 64/100