'Handle the case where we exceeded MAX_ERROR_COUNT'

def _handle_error_count_exceeded(self, error):

    msg = 'w3af    found    too    many    consecutive    errors    while    performing    HTTP    requests.    In    most    cases    this    means    that    the    remote    web    server    is    not    reachable    anymore,    the    network    is    down,    or    a    WAF    is    blocking    our    tests.    The    last    exception    message    was    "%s"    (%s.%s).'
    reason_msg = get_exception_reason(error)
    args = (error, error.__class__.__module__, error.__class__.__name__)
    if (reason_msg is not None):
        e = ScanMustStopByKnownReasonExc((msg % args), reason=reason_msg)
    else:
        last_errors = []
        last_n_responses = list(self._last_responses)[(- MAX_ERROR_COUNT):]
        for response_meta in last_n_responses:
            last_errors.append(response_meta.message)
        e = ScanMustStopByUnknownReasonExc((msg % args), errs=last_errors)
    self._stop_exception = e
    raise self._stop_exception
