Skip to content

Commit a841469

Browse files
committed
Warn on failure to query system configuration file
1 parent 61ed2a2 commit a841469

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

crates/uv-settings/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::env;
22
use std::ops::Deref;
33
use std::path::{Path, PathBuf};
44

5-
use tracing::debug;
5+
use tracing::{debug, warn};
66

77
use uv_fs::Simplified;
88
use uv_static::EnvVars;
@@ -241,7 +241,14 @@ fn system_config_file() -> Option<PathBuf> {
241241
// Fallback to `/etc/uv/uv.toml` if `XDG_CONFIG_DIRS` is not set or no valid
242242
// path is found.
243243
let candidate = Path::new("/etc/uv/uv.toml");
244-
candidate.is_file().then(|| candidate.to_path_buf())
244+
match candidate.try_exists() {
245+
Ok(true) => Some(candidate.to_path_buf()),
246+
Ok(false) => None,
247+
Err(err) => {
248+
warn!("Failed to query system configuration file: {err}");
249+
None
250+
}
251+
}
245252
}
246253
}
247254

0 commit comments

Comments
 (0)