From 6b85d719395d498ad1b8b218b18ed259ee864055 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Wed, 20 Aug 2025 16:29:18 +1200 Subject: Print event loop errors --- src/bin/br/main.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/bin/br/main.rs b/src/bin/br/main.rs index 11505cb..da11a18 100644 --- a/src/bin/br/main.rs +++ b/src/bin/br/main.rs @@ -130,8 +130,8 @@ fn main() { symbols_path, name, identifier, title, icon, }; - if let Ok(phosphor) = Phosphor::new() { - match mode { + match Phosphor::new() { + Ok(phosphor) => match mode { Mode::Dynamic => { info!("Starting graphical emulator (hidden)"); let mut emulator = GraphicalEmulator::new(config, debug); @@ -151,9 +151,9 @@ fn main() { emulator.run(); } } - } else { - match mode { + Err(err) => match mode { Mode::Dynamic => { + eprintln!("EventLoopError: {err:?}"); info!("Could not start graphical event loop"); info!("Starting headless emulator"); let mut emulator = HeadlessEmulator::new(&config, debug); @@ -161,6 +161,7 @@ fn main() { emulator.run(); } Mode::Graphical => { + eprintln!("EventLoopError: {err:?}"); fatal!("Could not start graphical event loop"); } Mode::Headless => { -- cgit v1.2.3-70-g09d2