gui_panic_handler

Crates.iogui_panic_handler
lib.rsgui_panic_handler
version0.1.0
created_at2025-04-15 19:31:31.389959+00
updated_at2025-04-15 19:31:31.389959+00
descriptionSimple panic handler which summons a GUI dialog, using egui
homepage
repositoryhttps://github.com/your_username/gui_panic_handler
max_upload_size
id1635085
size247,467
(FireFragment)

documentation

README

GUI panic handler

screenshot of a panic dialog

This crate allows you to handle panics with a simple GUI dialog made with egui.

The dialog shows panic payload, information about location of the panic and if you want, an option to report the panic to developer and external links.

Quickstart

fn main() {
    use gui_panic_handler::AppInfo;
    use gui_panic_handler::Link;

    gui_panic_handler::register(AppInfo {
        name: "GUI panic handler testing app",
        additional_text: "We are sorry, the app crashed. To let us fix the crash, please report it using the button below.",
        links: vec![
            Link {
                label: "Browse known crash causes",
                url: "https://example.com",
            },
            Link {
                label: "Get help on the forum",
                url: "https://example.com",
            },
            Link {
                label: "Our website",
                url: "https://example.com",
            },
        ],
        report_bug_url: Some(gui_panic_handler::github_report_bug_url(
            String::from("FireFragment"),
            String::from("rust_gui_panic_handler"),
        )),
    });

    println!("Reading env var...");
    let env_var_value = std::env::var("SUPER_IMPORTANT_ENVIRONMENT_VARIABLE").unwrap(); // Here we panic

    println!("Read: {env_var_value}")
}

If you use nix with flakes, you can see the dialog yourself just by running:

nix run git+https://github.com/FireFragment/rust_gui_panic_handler
Commit count: 0

cargo fmt