Skip to content

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 21, 2026

Description

This PR addresses issue #194 by adding checks for path existence and read permissions before initializing the file watcher in run_watch.

Changes

  • Added a check if the path exists.
  • Added a check if the path is readable (by attempting read_dir).
  • Used anyhow::bail! to return clear error messages to the user instead of propagating generic IO errors or crashing later.

Testing

  • Verified with non-existent directory -> Correctly reports "Path does not exist".
  • Verified with existing directory -> Proceed to watch.
  • (Implicitly) Permission denied on read_dir will now report "Failed to access directory ... Check permissions.".

Checklist

  • Code compiles
  • Tests pass
  • Manual verification

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.

2 participants