Don't fail if we can't canonicalize an event path
e.g. for deletes
@@ -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
+ }),
});
}
