gui_panic_handler 0.1.0

Simple panic handler which summons a GUI dialog, using egui
Documentation
  • Coverage
  • 57.89%
    11 out of 19 items documented2 out of 7 items with examples
  • Size
  • Source code size: 246.97 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 6.28 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2m 4s Average build duration of successful builds.
  • all releases: 2m 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • FireFragment

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