Skip to content

Commit

Permalink
fix(win,gui): don't hide error message on GUI creation
Browse files Browse the repository at this point in the history
Previous `.context` was hiding the errors during the gui building stage,
leading to:
#990 (comment)

This fixes it and now it should bubble up the original error

(anyhow's trait isn't implemented for NWG errors, so not sure you can
conveniently chain both)
  • Loading branch information
eugenesvk authored May 18, 2024
1 parent 490e2cc commit 34882a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/win.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::Kanata;
use anyhow::{bail, Context, Result};
use anyhow::{bail, Result};
use core::cell::RefCell;
use log::Level::*;

Expand Down Expand Up @@ -986,7 +986,7 @@ pub fn build_tray(cfg: &Arc<Mutex<Kanata>>) -> Result<system_tray_ui::SystemTray
app_data: RefCell::new(app_data),
..Default::default()
};
SystemTray::build_ui(app).context("Failed to build UI")
Ok(SystemTray::build_ui(app)?)
}

pub use log::*;
Expand Down

0 comments on commit 34882a6

Please sign in to comment.