def check_response_body(response_body):
    """
    检查 response body: err_code 不为 0 时抛出 :class:`ResponseError` 异常

    :param response_body: response body
    """

    try:
        base_response = response_body['BaseResponse']
        err_code = base_response['Ret']
        err_msg = base_response['ErrMsg']
    except (KeyError, TypeError):
        pass
    else:
        if err_code != 0:
            if int(err_code) > 0:
                err_msg = decode_text_from_webwx(err_msg)
            raise ResponseError(err_code=err_code, err_msg=err_msg)
检查 response body: err_code 不为 0 时抛出 :class:`ResponseError` 异常

:param response_body: response body
wxpy/utils/misc.py