예제 #1
0
def report_not_supported_err(method_name):
    err_result = BCResult()
    err_result.result_code = NOT_SUPPORTED_CODE
    err_result.result_msg = NOT_SUPPORTED_NAME
    err_result.err_detail = u'[{:s}] does NOT support test mode currently!'.format(
        method_name)
    return err_result
예제 #2
0
def _deal_with_invalid_resp(http_resp):
    resp = BCResult()
    resp.result_code = NETWORK_ERROR_CODE
    resp.result_msg = http_resp.status_code
    resp.err_detail = http_resp.reason
    return URL_REQ_FAIL, resp
예제 #3
0
def _deal_with_conn_error():
    resp = BCResult()
    resp.result_code = NETWORK_ERROR_CODE
    resp.result_msg = NETWORK_ERROR_NAME
    resp.err_detail = 'ConnectionError: normally caused by timeout'
    return URL_REQ_FAIL, resp
예제 #4
0
def report_not_supported_err(method_name):
    err_result = BCResult()
    err_result.result_code = NOT_SUPPORTED_CODE
    err_result.result_msg = NOT_SUPPORTED_NAME
    err_result.err_detail = u'[{:s}] does NOT support test mode currently!'.format(method_name)
    return err_result
예제 #5
0
def _deal_with_invalid_resp(http_resp):
    resp = BCResult()
    resp.result_code = NETWORK_ERROR_CODE
    resp.result_msg = http_resp.status_code
    resp.err_detail = http_resp.reason
    return URL_REQ_FAIL, resp
예제 #6
0
def _deal_with_conn_error():
    resp = BCResult()
    resp.result_code = NETWORK_ERROR_CODE
    resp.result_msg = NETWORK_ERROR_NAME
    resp.err_detail = 'ConnectionError: normally caused by timeout'
    return URL_REQ_FAIL, resp