def METHOD_NAME(*args, **kwargs):
    # 判断是否抛异常
    raise_exception = kwargs.pop("raise_exception", True)
    try:
        resp = func(*args, **kwargs)
        format_func = FORMAT_FUNC.get(f)
        if format_func:
            # 获取内容
            if isinstance(resp, Response):
                content = resp.text
            elif isinstance(resp, six.string_types):
                content = resp
            else:
                raise ValueError(_("返回值[{}]必须是字符串或者Response对象").format(resp))
            # 解析格式
            err_msg = kwargs.get("err_msg", None)
            try:
                resp = format_func(content)
            except Exception as e:
                logger.exception("请求第三方失败，使用【%s】格式解析 %s 异常，%s", f, content, e)
                error = ComponentError(err_msg or e)
                # 设置response, 上层使用可进一步判断
                error.response = resp
                raise error
        if handle_resp:
            if resp.get("code") != ErrorCode.NoError:
                raise APIError(resp.get("message"))
            return resp.get("data")
        return resp
    except Exception as e:
        if raise_exception:
            raise
        return {"message": str(e)}