diff --git a/lib/src/fs.rs b/lib/src/fs.rs index 0b4546c..83969fd 100644 --- a/lib/src/fs.rs +++ b/lib/src/fs.rs @@ -11,7 +11,7 @@ use std::{ use notify::Watcher as _; use tokio::sync::{mpsc, watch}; -use tracing::{debug, error, trace}; +use tracing::{debug, error, trace, warn}; use crate::{ error::{CriticalError, RuntimeError}, @@ -286,10 +286,10 @@ fn process_event( // possibly pull file_type from whatever notify (or the native driver) returns? tags.push(Tag::Path { file_type: metadata(&path).ok().map(|m| m.file_type().into()), - path: dunce::canonicalize(path).map_err(|err| RuntimeError::IoError { - about: "canonicalise path in event", - err, - })?, + path: dunce::canonicalize(&path).unwrap_or_else(|err| { + warn!(?err, ?path, "failed to canonicalise event path"); + path + }), }); }