mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-12 13:58:28 +00:00
Improve error handling
This commit is contained in:
parent
7669a8edef
commit
c77b56a688
@ -31,7 +31,7 @@ impl ViewerWindow {
|
|||||||
pub async fn new(
|
pub async fn new(
|
||||||
event_loop: &ActiveEventLoop,
|
event_loop: &ActiveEventLoop,
|
||||||
) -> Result<Self, WindowError> {
|
) -> Result<Self, WindowError> {
|
||||||
let window = Window::new(event_loop).unwrap();
|
let window = Window::new(event_loop)?;
|
||||||
let renderer = Renderer::new(&window).await?;
|
let renderer = Renderer::new(&window).await?;
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
@ -189,6 +189,9 @@ impl ViewerWindow {
|
|||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum WindowError {
|
pub enum WindowError {
|
||||||
|
#[error("Failed to initialize window")]
|
||||||
|
WindowInit(#[from] winit::error::OsError),
|
||||||
|
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
RendererInit(#[from] RendererInitError),
|
RendererInit(#[from] RendererInitError),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user