From 8962d8b214d9801f84ed931ac9588dc90f4fcff6 Mon Sep 17 00:00:00 2001 From: Marc Planard Date: Sat, 3 Jun 2023 16:38:55 +0200 Subject: [PATCH] log error --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0dd37c8..ddf3328 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,7 +31,7 @@ pub fn main() -> Result<(), Box> { Ok(rs) => rs, Err(err) => { println!("Unable to connect to redis: {:?}", err); - return Err(err) + return Ok(()) } }; @@ -39,7 +39,11 @@ pub fn main() -> Result<(), Box> { let controller = NativeHeliosDacController::new()?; let devices = controller.list_devices()?; - let device = devices.into_iter().next().unwrap(); + let Some(device) = devices.into_iter().next() else { + println!("Unable to find an helios device"); + return Ok(()); + }; + let mut device = device.open()?; while running.load(Ordering::SeqCst) {