Skip to main content

shield_panic

Function shield_panic 

Source
pub fn shield_panic<T, F>(f: F) -> Result<T, StructuredError>
where F: FnOnce() -> T + UnwindSafe,
Expand description

Catch panics and convert to a structured error so they don’t cross FFI boundaries.

§Errors

Returns a structured error if a panic occurs during function execution.