Recover from panics in the wrapped function