Skip to content

Commit

Permalink
Merge pull request #1539 from hannobraun/error
Browse files Browse the repository at this point in the history
Box event loop error variants
  • Loading branch information
hannobraun authored Jan 26, 2023
2 parents b8a375a + 18d1cbc commit c850ddd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/fj-window/src/event_loop_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl EventLoopHandler {
event: Event<ModelEvent>,
control_flow: &mut ControlFlow,
) -> Result<(), Error> {
// Trigger a panic if the host thead has panicked.
// Trigger a panic if the host thread has panicked.
self.host.propagate_panic();

if let Event::WindowEvent { event, .. } = &event {
Expand Down Expand Up @@ -91,7 +91,7 @@ impl EventLoopHandler {
}

ModelEvent::Error(err) => {
return Err(err.into());
return Err(Box::new(err).into());
}
},
Event::WindowEvent {
Expand Down Expand Up @@ -184,8 +184,8 @@ impl EventLoopHandler {
gui_state,
);
if let Some(model_path) = new_model_path {
let model =
Model::new(model_path, Parameters::empty())?;
let model = Model::new(model_path, Parameters::empty())
.map_err(Box::new)?;
self.host.load_model(model);
}
}
Expand Down Expand Up @@ -262,10 +262,10 @@ fn input_event<T>(
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Host error")]
Host(#[from] fj_host::Error),
Host(#[from] Box<fj_host::Error>),

#[error("Shape processing error")]
ShapeProcessor(#[from] shape_processor::Error),
ShapeProcessor(#[from] Box<shape_processor::Error>),
}

/// Affects the speed of zoom movement given a scroll wheel input in lines.
Expand Down

0 comments on commit c850ddd

Please sign in to comment.