From 2d62503fdf042a215ebb9647e8a69f2d6dbde218 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 22 Aug 2025 13:41:12 -0700 Subject: [PATCH] fix: don't error when default config for toolkit settings is not present --- src/app/cosmic.rs | 6 ++++++ src/config/mod.rs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/app/cosmic.rs b/src/app/cosmic.rs index 9814cf70..17331832 100644 --- a/src/app/cosmic.rs +++ b/src/app/cosmic.rs @@ -369,6 +369,12 @@ where .into_iter() .filter(cosmic_config::Error::is_err) { + if let cosmic_config::Error::GetKey(_, err) = &why { + if err.kind() == std::io::ErrorKind::NotFound { + // No system default config installed; don't error + continue; + } + } tracing::error!(?why, "cosmic toolkit config update error"); } diff --git a/src/config/mod.rs b/src/config/mod.rs index dedadbc2..1253ce8d 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -25,6 +25,12 @@ pub static COSMIC_TK: LazyLock> = LazyLock::new(|| { .map(|c| { CosmicTk::get_entry(&c).unwrap_or_else(|(errors, mode)| { for why in errors.into_iter().filter(cosmic_config::Error::is_err) { + if let cosmic_config::Error::GetKey(_, err) = &why { + if err.kind() == std::io::ErrorKind::NotFound { + // No system default config installed; don't error + continue; + } + } tracing::error!(?why, "CosmicTk config entry error"); } mode