From 5db8a188a09c2ca1c303c7e83213bb3786490c0c Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 25 May 2022 14:00:05 +0200 Subject: [PATCH] Add dedicated error type for main loop --- crates/fj-viewer/src/run.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/fj-viewer/src/run.rs b/crates/fj-viewer/src/run.rs index 1b3d5731a..7c91e3e6d 100644 --- a/crates/fj-viewer/src/run.rs +++ b/crates/fj-viewer/src/run.rs @@ -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(); @@ -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), +}