diff --git a/src/watch.rs b/src/watch.rs index 6fb6773..a192790 100644 --- a/src/watch.rs +++ b/src/watch.rs @@ -1,7 +1,6 @@ -use anyhow::{bail, Result}; +use anyhow::{Context, Result}; use serde::Deserialize; -use std::io::ErrorKind; -use tracing::{error, trace}; +use tracing::trace; use watchman_client::{prelude::*, Subscription}; use crate::config::Bucket; @@ -24,17 +23,9 @@ pub async fn generate_subscriptions<'a>( } let mut subs = vec![]; for path in &bucket.sources { - let canonical_path = match CanonicalPath::canonicalize(path) { - Ok(path) => path, - Err(err) => { - if err.kind() == ErrorKind::NotFound { - error!("Directory {} not found, ignoring...", path.display()); - continue; - } - bail!(err) - } - }; - let resolved = client.resolve_root(canonical_path).await?; + let resolved = client + .resolve_root(CanonicalPath::canonicalize(path).context(format!("{}", path.display()))?) + .await?; trace!( "Adding subscription for {}", resolved.path().as_path().display()