From 1f482ab512b0b19da9c93bbfaaeea7c1c56dc46a Mon Sep 17 00:00:00 2001 From: Erica Z Date: Wed, 6 Nov 2024 22:12:03 +0100 Subject: [PATCH] die on panic --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index 42ca808..bc7b17f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,6 +30,13 @@ fn init_tracing() { fn init_tracing() {} fn main() -> glib::ExitCode { + // abort on any panic + let orig_hook = std::panic::take_hook(); + std::panic::set_hook(Box::new(move |panic_info| { + orig_hook(panic_info); + std::process::exit(1); + })); + gio::resources_register_include!("audrey.gresource").expect("could not register resources"); init_tracing();