Skip to content

Comments

Make ErrorKind::PathNotFound consistent on inotify#611

Merged
0xpr03 merged 1 commit intonotify-rs:mainfrom
y5c4l3:inotify-path-error
Jul 14, 2024
Merged

Make ErrorKind::PathNotFound consistent on inotify#611
0xpr03 merged 1 commit intonotify-rs:mainfrom
y5c4l3:inotify-path-error

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 <[email protected]>
@0xpr03
Copy link
Member

0xpr03 commented Jul 14, 2024

Thanks!

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