Skip to main content

Module fault

Module fault 

Source
Expand description

Fault boundaries: a panel whose drawing code panics shows an error card instead of taking the application down. The panic is caught (catch_unwind), logged, and kept until the user retries.

Where panics abort (panic = "abort", or WebAssembly without unwinding) nothing can be caught; the boundary then changes nothing.

use egui_pop_core::fault;

fn panel(ui: &mut egui::Ui) {
    fault::boundary(ui, "inspector", "Inspector", |ui| {
        ui.label("Drawn by code that might panic");
    });
}

Structs§

Fault
A caught panic.

Functions§

boundary
Draws add inside a boundary named name. Returns None while the boundary shows its error card.
boundary_reporting
Draws add as boundary does, and hands a panic it catches to failed, once per failure: for the caller to say what failed in its own words (a panel’s id, its owner) and to publish it.
faults
The faults currently shown, for the debug bridge.