def METHOD_NAME(func, args, kwargs):
    try:
        ret = func(*args, **kwargs)
        err = None
    except Exception as e:
        if not isinstance(e, accept_error):
            raise
        ret = None
        err = e
    return ret, err