Function mz_ore::panic::catch_unwind_str

source ยท
pub fn catch_unwind_str<F, R>(f: F) -> Result<R, Cow<'static, str>>
where F: FnOnce() -> R + UnwindSafe,
Expand description

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

See: https://doc.rust-lang.org/stable/std/panic/struct.PanicHookInfo.html#method.payload