def _raise_for_status(response):
    http_error_msg = ""

    if 400 <= response.status_code < 500:
        http_error_msg = "{0} Client Error: {1}".format(response.status_code,
                                                        response.reason)

    elif 500 <= response.status_code < 600:
        http_error_msg = "{0} Server Error: {1}".format(response.status_code,
                                                        response.reason)

    if http_error_msg:
        try:
            more_info = response.json().get("message")
        except ValueError:
            more_info = None
        if more_info and more_info.lower() != response.reason.lower():
            http_error_msg += ".\n\t{0}".format(more_info)
        raise requests.exceptions.HTTPError(http_error_msg, response=response)
Test connectTCP gets called with fallback parameters on bad result.
dataset/ETHPy150Open xmunoz/sodapy/sodapy/__init__.py/_raise_for_status--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/names/test/test_srvconnect.py/SRVConnectorTest.test_SRVBadResult