log error

This commit is contained in:
Marc Planard 2023-06-03 16:38:55 +02:00
parent 3ad7bbf1ef
commit 8962d8b214

View File

@ -31,7 +31,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(rs) => rs, Ok(rs) => rs,
Err(err) => { Err(err) => {
println!("Unable to connect to redis: {:?}", err); println!("Unable to connect to redis: {:?}", err);
return Err(err) return Ok(())
} }
}; };
@ -39,7 +39,11 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
let controller = NativeHeliosDacController::new()?; let controller = NativeHeliosDacController::new()?;
let devices = controller.list_devices()?; 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()?; let mut device = device.open()?;
while running.load(Ordering::SeqCst) { while running.load(Ordering::SeqCst) {