Available on crate feature
panic and non-target_family=wasm only.Expand description
Panic utilities.
StructsΒ§
- Caught
Panic - A panic recovered by
catch_unwind_with_details, bundling the panic message with the location and backtrace captured at the panic site. - Panic
Details π - Details about a caught panic, recorded at the panic site by the enhanced
panic handler and consumed by
catch_unwind_with_details. Internal: the public-facing type isCaughtPanic.
ConstantsΒ§
- CAPTURE_
PANIC_ πDETAILS - Keeps track of how many
catch_unwind_with_detailscalls we are inside. - CATCHING_
UNWIND π - Keeps track of how many
catch_unwindcalls we are inside. - CAUGHT_
PANIC_ πDETAILS - Details about the most recently caught panic, recorded by the enhanced
panic handler when
CAPTURE_PANIC_DETAILSis non-zero. Consumed bycatch_unwind_with_details.
StaticsΒ§
FunctionsΒ§
- catch_
unwind - Like
std::panic::catch_unwind, but can unwind panics even ifinstall_enhanced_handlerhas been called. - catch_
unwind_ str - Like
crate::panic::catch_unwind, but downcasts the returnedBox<dyn Any>error to a string which is almost always is. - catch_
unwind_ with_ details - Like
catch_unwind_str, but on panic also recovers the panicβs source location and a backtrace captured at the panic site, bundled together in aCaughtPanic. - downcast_
panic_ πmessage - Downcasts an opaque panic payload (as returned by
catch_unwind) to its message string, which it almost always is. - install_
enhanced_ handler - Overwrites the default panic handler with an enhanced panic handler.