From 6bcb06a32fcbb41e58416d34ec79a404f4096158 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Thu, 30 Nov 2023 15:53:55 +0100 Subject: [PATCH] cope with unavailable flrig --- src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index ef8e979..e94c164 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,10 +19,13 @@ fn main() { }; let mut changes_detected = false; - + loop { - let radio_data_new = - flrig::get_radio_data(&settings.flrig.host, &settings.flrig.port).unwrap(); + let radio_data_new = match flrig::get_radio_data(&settings.flrig.host, &settings.flrig.port) + { + Ok(res) => res, + Err(_) => continue, + }; if radio_data_current.frequency != radio_data_new.frequency || radio_data_current.mode != radio_data_new.mode