mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-07 19:38:29 +00:00
Improve error handling
This commit is contained in:
parent
72fcf21580
commit
9cb33e8bd3
@ -27,9 +27,15 @@ struct App {
|
||||
impl ApplicationHandler for App {
|
||||
fn resumed(&mut self, event_loop: &ActiveEventLoop) {
|
||||
let window = {
|
||||
let window = event_loop
|
||||
.create_window(WindowAttributes::default())
|
||||
.unwrap();
|
||||
let window =
|
||||
match event_loop.create_window(WindowAttributes::default()) {
|
||||
Ok(window) => window,
|
||||
Err(err) => {
|
||||
eprintln!("Failed to create window: `{err:?}`");
|
||||
event_loop.exit();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
Arc::new(window)
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user