Better log canonicalization errors (#32030)

Based on
https://github.com/zed-industries/zed/issues/18673#issuecomment-2933025951

Adds an anyhow error context with the path used for canonicalization
(also, explicitly mention path at the place from the comment).

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-06-04 01:30:59 +03:00 committed by GitHub
parent 2db2271e3c
commit faa0bb51c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -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 {