Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions notify-debouncer-full/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl schema::Error {
"path-not-found" => ErrorKind::PathNotFound,
"watch-not-found" => ErrorKind::WatchNotFound,
"max-files-watch" => ErrorKind::MaxFilesWatch,
"fs-event-stream-start" => ErrorKind::FsEventStreamStart,
_ => panic!("unknown error type `{}`", self.kind),
};
let mut error = Error::new(kind);
Expand Down
4 changes: 4 additions & 0 deletions notify/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ pub enum ErrorKind {

/// Can't watch (more) files, limit on the total number of inotify watches reached
MaxFilesWatch,

/// The FSEvents stream failed to start.
FsEventStreamStart,
}

/// Notify error type.
Expand Down Expand Up @@ -116,6 +119,7 @@ impl fmt::Display for Error {
ErrorKind::Generic(ref err) => err.clone(),
ErrorKind::Io(ref err) => err.to_string(),
ErrorKind::MaxFilesWatch => "OS file watch limit reached.".into(),
ErrorKind::FsEventStreamStart => "Unable to start FSEvents stream.".into(),
};

if self.paths.is_empty() {
Expand Down
5 changes: 3 additions & 2 deletions notify/src/fsevent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

use crate::{event::*, PathOp};
use crate::{
unbounded, Config, Error, EventHandler, EventKindMask, RecursiveMode, Result, Sender, Watcher,
unbounded, Config, Error, ErrorKind, EventHandler, EventKindMask, RecursiveMode, Result,
Sender, Watcher,
};
use objc2_core_foundation as cf;
use objc2_core_services as fs;
Expand Down Expand Up @@ -521,7 +522,7 @@ impl FsEventWatcher {
fs::FSEventStreamInvalidate(stream);
fs::FSEventStreamRelease(stream);
rl_tx
.send(Err(Error::generic("unable to start FSEvent stream")))
.send(Err(Error::new(ErrorKind::FsEventStreamStart)))
.expect("Unable to send error for FSEventStreamStart");
return;
}
Expand Down
Loading