You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(processor): refine error handling for file/directory path conflicts
Addresses failing tests observed specifically on the Ubuntu CI runner. These
failures were related to filesystem operations where path components might
exist as files instead of the expected directories.
The previous error handling in the processor could mask these specific
file/directory conflict errors, often reporting them as generic I/O or
path canonicalization failures. This inconsistency likely caused test
assertions (e.g., on summary counts or specific error types) to fail on
the Ubuntu environment.
This change improves the robustness and cross-platform consistency of
error handling by:
- Using `fs::metadata` more proactively in `create.rs` and `safety.rs` to
check the type of existing path components before proceeding.
- Explicitly catching `io::ErrorKind::NotADirectory` during metadata checks,
directory creation (`create_dir_all`), file writing (`fs::write`), and
path canonicalization.
- Mapping these specific file/directory conflict errors to the more precise
`ProcessError::ParentIsNotDirectory` and `ProcessError::TargetIsDirectory`
variants.
- Ensuring the `summary_updater` correctly increments specific failure
counters (`failed_parent_isdir`, `failed_isdir_create`) based on these
refined error types, leading to more accurate summaries.
- Centralizing summary updates for path format errors in `action_handler.rs`.
This resolves the CI failures by providing more accurate error detection
and reporting, leading to consistent behavior and correct summary counts
across different environments.
0 commit comments