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

@ -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;
}
};