Skip to content

Commit 2d62503

Browse files
authored
fix: don't error when default config for toolkit settings is not present
1 parent 8415d77 commit 2d62503

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/app/cosmic.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,12 @@ where
369369
.into_iter()
370370
.filter(cosmic_config::Error::is_err)
371371
{
372+
if let cosmic_config::Error::GetKey(_, err) = &why {
373+
if err.kind() == std::io::ErrorKind::NotFound {
374+
// No system default config installed; don't error
375+
continue;
376+
}
377+
}
372378
tracing::error!(?why, "cosmic toolkit config update error");
373379
}
374380

src/config/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ pub static COSMIC_TK: LazyLock<RwLock<CosmicTk>> = LazyLock::new(|| {
2525
.map(|c| {
2626
CosmicTk::get_entry(&c).unwrap_or_else(|(errors, mode)| {
2727
for why in errors.into_iter().filter(cosmic_config::Error::is_err) {
28+
if let cosmic_config::Error::GetKey(_, err) = &why {
29+
if err.kind() == std::io::ErrorKind::NotFound {
30+
// No system default config installed; don't error
31+
continue;
32+
}
33+
}
2834
tracing::error!(?why, "CosmicTk config entry error");
2935
}
3036
mode

0 commit comments

Comments
 (0)