Skip to content

Commit

Permalink
Add dedicated error type for main loop
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed May 25, 2022
1 parent 8c1b4c9 commit 5db8a18
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/fj-viewer/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{
pub fn run(
watcher: Watcher,
shape_processor: ShapeProcessor,
) -> Result<(), graphics::InitError> {
) -> Result<(), Error> {
let event_loop = EventLoop::new();
let window = Window::new(&event_loop).unwrap();

Expand Down Expand Up @@ -159,3 +159,11 @@ pub fn run(
}
});
}

/// Error in main loop
#[derive(Debug, thiserror::Error)]
pub enum Error {
/// Error initializing graphics
#[error("Error initializing graphics")]
GraphicsInit(#[from] graphics::InitError),
}

0 comments on commit 5db8a18

Please sign in to comment.