Skip to content

Add error logging for file tree I/O failures#9

Merged
Keshav-writes-code merged 1 commit intomigrate-filetree-to-rust-7043552137559722624from
copilot/sub-pr-6-another-one
Dec 10, 2025
Merged

Add error logging for file tree I/O failures#9
Keshav-writes-code merged 1 commit intomigrate-filetree-to-rust-7043552137559722624from
copilot/sub-pr-6-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 10, 2025

Addresses feedback on PR #6 to log I/O errors during file tree construction. Previously, errors when reading directory entries or metadata were silently ignored, making it difficult to troubleshoot missing files.

Changes

  • Added error logging for subdirectory read failures using eprintln!
  • Changed from if let Ok() to match statement to handle both success and error cases
  • Errors when reading individual directory entries or metadata still use if let Ok() pattern (non-critical - these entries are simply skipped)

Example

// Before
if let Ok(sub_children) = build_tree_recursive_desktop(&path) {
    children = sub_children;
}

// After  
match build_tree_recursive_desktop(&path) {
    Ok(sub_children) => {
        children = sub_children;
    }
    Err(e) => {
        eprintln!("Failed to read subdirectory '{}': {}", path, e);
    }
}

This provides visibility into permission issues or I/O errors for subdirectories while maintaining the existing behavior of silently skipping individual problematic entries.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] WIP address feedback on Rust backend file tree creation migration Add error logging for file tree I/O failures Dec 10, 2025
@Keshav-writes-code Keshav-writes-code marked this pull request as ready for review December 10, 2025 18:56
Copilot AI review requested due to automatic review settings December 10, 2025 18:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Keshav-writes-code Keshav-writes-code merged commit 91ebfeb into migrate-filetree-to-rust-7043552137559722624 Dec 10, 2025
6 checks passed
@Keshav-writes-code Keshav-writes-code deleted the copilot/sub-pr-6-another-one branch December 10, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants