Skip to main content

catch_unwind_str

Function catch_unwind_str 

Source
pub fn catch_unwind_str<F, R>(f: F) -> Result<R, Cow<'static, str>>
where F: FnOnce() -> R + UnwindSafe,
Available on crate feature panic and non-target_family=wasm only.
Expand description

Like crate::panic::catch_unwind, but downcasts the returned Box<dyn Any> error to a string which is almost always is.