[][src]Function exonum::runtime::catch_panic

pub fn catch_panic<F, T>(maybe_panic: F) -> Result<T, ExecutionError> where
    F: FnOnce() -> Result<T, ExecutionError>, 

Invokes closure, capturing the cause of the unwinding panic if one occurs.

This function will return the result of the closure if the closure does not panic. If the closure panics, it returns an Unexpected error with the description derived from the panic object.

merkledbs are not caught by this method.