fix(cosmic_config): treat errors getting key_path in get_local as NotFound

This commit is contained in:
Michael Aaron Murphy 2025-02-14 22:39:09 +01:00
parent ccc1068d9f
commit cd8f4ee859
No known key found for this signature in database
GPG key ID: B2732D4240C9212C

View file

@ -329,8 +329,8 @@ impl ConfigGet for Config {
fn get_local<T: DeserializeOwned>(&self, key: &str) -> Result<T, Error> {
// If key path exists
match self.key_path(key)? {
key_path if key_path.is_file() => {
match self.key_path(key) {
Ok(key_path) if key_path.is_file() => {
// Load user override
let data = fs::read_to_string(key_path)
.map_err(|err| Error::GetKey(key.to_string(), err))?;