def _hc_retry_on_exception(err):
    if isinstance(err, HTTPError) and err.response.status_code in _HTTP_ERROR_CODES_TO_RETRY:
        logger.warning("Server failed with %d status code, retrying (maybe)", err.response.status_code)
        return True

    if isinstance(err, ConnectionError):
        logger.warning("Request encountered a connection error: %r, retrying (maybe)", err)
        return True

    if isinstance(err, Timeout):
        logger.warning("Server connection timeout, retrying (maybe)")
        return True

    return False
Callback used by the client to restrict the retry to acceptable errors
dataset/ETHPy150Open scrapinghub/python-hubstorage/hubstorage/client.py/_hc_retry_on_exception