Function web_panic_report::set_hook_with

source ·
pub fn set_hook_with<F1, F2>(
    container_id: impl Into<String>,
    form_html: impl Into<String>,
    on_panic_callback: F1,
    submit_callback: F2,
)
where F1: Fn(&WasmPanicInfo) + Send + Sync + 'static, F2: Fn(&WasmPanicInfo) + Send + Sync + 'static,
Expand description

Set the panic hook.

§Params

container_id: The ID of the HTML element that will be unmounted in favor of the form.
form_html: The raw HTML that will replace the container.
on_panic_callback: A closure that is triggered on panic automatically.
submit_callback: The closure that will run when the user hits the send report button.

§Panics

This will panic (ironically) if the panic is caught in a headless environment.