Skip to main content

Module error

Module error 

Source
Expand description

Stateful error boundary.

ErrorBoundary catches panics thrown from its content closure (reliable on native) and also supports a WASM-safe failure path via throw_boundary: panics abort on wasm32-unknown-unknown builds compiled with panic = "abort", so catch_unwind is best-effort there.

The boundary is sticky: once a fallback is shown it stays until the reset callback fires. This prevents a panicking leaf from re-panicking every frame and means the Reset button lives in the fallback, not the failing content.

Structs§

ErrorInfo
Details about a boundary trip, passed to the fallback.

Functions§

ErrorBoundary
Render fallback when content panics (native) or calls throw_boundary, and stay in fallback until reset() runs. fallback(info, reset) receives the error and a closure that clears the error and re-enters content.
throw_boundary
Call from inside a boundary’s content to trip the fallback without panic!. This is the WASM-safe path.