Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ErrorKind::PathNotFound consistent on inotify #611

Merged
merged 1 commit into from
Jul 14, 2024

Conversation

y5c4l3
Copy link
Contributor

@y5c4l3 y5c4l3 commented Jul 1, 2024

Before this patch, watching a nonexistent path using inotify backend would give an ErrorKind::Io variant. This behavior was inconsistent with other backends.

I am not sure if this is expected but taking #110 into consideration I think the path error ought to be consistent.

Run the inotify watcher on Linux:

let error = watcher.watch(Path::new("/nonexistent"), notify::RecursiveMode::Recursive).unwrap_err();

Before:

Error { kind: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" }), paths: [] }

After:

Error { kind: PathNotFound, paths: [] }

Before this patch, watching a nonexistent path using inotify backend
would give an `ErrorKind::Io` variant. This behavior was inconsistent
with other backends.

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
@0xpr03
Copy link
Member

0xpr03 commented Jul 14, 2024

Thanks!

@0xpr03 0xpr03 merged commit 96dec74 into notify-rs:main Jul 14, 2024
13 checks passed
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