Skip to main content

catch_panic

Function catch_panic 

Source
pub fn catch_panic<R>(what: &str, fallback: R, body: impl FnOnce() -> R) -> R
Expand description

Runs body; a panic is logged as “what panicked (…)” and fallback is returned instead of unwinding. For function-hook detours and other plain functions the game calls directly, where no adapter of this crate stands between: a panic out of an extern "C" function aborts the game.