Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Better log canonicalization errors (#32030)
Kirill Bulatovfaa0bb51c97c
diff --git a/crates/fs/src/fs.rs b/crates/fs/src/fs.rsindex 3acc974c989..8bedb90b1a1 100644--- a/crates/fs/src/fs.rs+++ b/crates/fs/src/fs.rs@@ -597,7 +597,9 @@ impl Fs for RealFs {}async fn canonicalize(&self, path: &Path) -> Result<PathBuf> {- Ok(smol::fs::canonicalize(path).await?)+ Ok(smol::fs::canonicalize(path)+ .await+ .with_context(|| format!("canonicalizing {path:?}"))?)}async fn is_file(&self, path: &Path) -> bool {diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rsindex fe8104e1cdb..62ce35789e4 100644--- a/crates/worktree/src/worktree.rs+++ b/crates/worktree/src/worktree.rs@@ -3948,7 +3948,7 @@ impl BackgroundScanner {let root_canonical_path = match self.fs.canonicalize(root_path.as_path()).await {Ok(path) => SanitizedPath::from(path),Err(err) => {- log::error!("failed to canonicalize root path: {}", err);+ log::error!("failed to canonicalize root path {root_path:?}: {err}");return true;}};