We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ace673e + 5721b0b commit 8bee5f0Copy full SHA for 8bee5f0
src/lib.rs
@@ -85,10 +85,13 @@ pub fn get_module() -> Module {
85
.argument(Argument::by_val("path"));
86
87
watcher.add_method("watch", Visibility::Public, |this, arguments| {
88
- let handler = arguments.get_mut(0).unwrap();
+ let handler = arguments.get_mut(0)
89
+ .ok_or(NotifyError::new("Failed to get mutable handler"))?;
90
+
91
let (tx, rx) = std::sync::mpsc::channel();
92
- let mut watcher = RecommendedWatcher::new(tx, Config::default()).unwrap();
93
+ let mut watcher = RecommendedWatcher::new(tx, Config::default())
94
+ .map_err(NotifyError::new)?;
95
let map = this.get_mut_property("map").expect_mut_z_arr()?;
96
97
for (k, v) in map.iter() {
0 commit comments