diff options
author | Ben Bridle <ben@derelict.engineering> | 2025-09-19 11:47:43 +1200 |
---|---|---|
committer | Ben Bridle <ben@derelict.engineering> | 2025-09-19 11:48:41 +1200 |
commit | 661b4012654c8b41a782adf6a5cc1092b8942803 (patch) | |
tree | 12ee614b569b31f1315a3fc3d234fb61237e7557 /src/bin/br | |
parent | 62e42e6082e8d7ff359d7b6bbdbd9eb1549956df (diff) | |
download | bedrock-pc-661b4012654c8b41a782adf6a5cc1092b8942803.zip |
Print phosphor event loop errors
If the phosphor event loop could not be started, the returned error
will be printed in the error message. This commit also updates the
phosphor dependency to version 3.3.2, which returns the actual error
object when an event loop error occurs.
Diffstat (limited to 'src/bin/br')
-rw-r--r-- | src/bin/br/main.rs | 9 |
1 files changed, 5 insertions, 4 deletions
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 => { |