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
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
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
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
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
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