Skip to content

Commit

Permalink
Improve handling of model loading errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Nov 29, 2022
1 parent 8e106eb commit 3e59f5e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions crates/fj-window/src/event_loop_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,8 @@ impl EventLoopHandler {
if let Some(model_path) = new_model_path {
let model =
Model::new(model_path, Parameters::empty()).unwrap();
match Host::from_model(model) {
Ok(new_host) => {
self.host = Some(new_host);
}
Err(err) => {
self.status.update_status(&format!(
"Error creating host: {err}"
));
}
}
let new_host = Host::from_model(model)?;
self.host = Some(new_host);
}
}
_ => {}
Expand Down

0 comments on commit 3e59f5e

Please sign in to comment.