Skip to content

Commit

Permalink
Improve error message when a partition target doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
LPGhatguy committed Mar 27, 2018
1 parent 135c287 commit 42d5b91
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/vfs/vfs_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ impl VfsWatcher {
let (tx, rx) = mpsc::channel();

let mut watcher: RecommendedWatcher = Watcher::new(tx, Duration::from_secs(1))
.expect("Unable to create watcher!");
.expect("Unable to create watcher! This is a bug in Rojo.");

watcher
.watch(&root_path, RecursiveMode::Recursive)
.expect("Unable to watch path!");
match watcher.watch(&root_path, RecursiveMode::Recursive) {
Ok(_) => (),
Err(_) => {
panic!("Unable to watch partition {}, with path {}! Make sure that it's a file or directory.", partition_name, root_path.display());
},
}

watchers.push(watcher);

Expand Down

0 comments on commit 42d5b91

Please sign in to comment.