def METHOD_NAME(func):
    # type: (F) -> F
    """
    Wrap task call with a try catch to get exceptions.
    Pass the client on to raise_exception so it can get rebinded.
    """
    client = Hub.current.client
    @wraps(func)
    def _inner(*args, **kwargs):
        # type: (*Any, **Any) -> Any
        try:
            gen = func(*args, **kwargs)
        except Exception:
            raise_exception(client)
        if not isinstance(gen, types.GeneratorType):
            return gen
        return _wrap_generator_call(gen, client)
    setattr(_inner, USED_FUNC, True)
    return _inner  # type: ignore