Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
_retry.py30 linesDownload Raw Back to _internal
1def default_retry_on(exc: Exception) -> bool:2    import httpx3    import requests4 5    if isinstance(exc, ConnectionError):6        return True7    if isinstance(exc, httpx.HTTPStatusError):8        return 500 <= exc.response.status_code < 6009    if isinstance(exc, requests.HTTPError):10        return 500 <= exc.response.status_code < 600 if exc.response else True11    if isinstance(12        exc,13        (14            ValueError,15            TypeError,16            ArithmeticError,17            ImportError,18            LookupError,19            NameError,20            SyntaxError,21            RuntimeError,22            ReferenceError,23            StopIteration,24            StopAsyncIteration,25            OSError,26        ),27    ):28        return False29    return True30 
codekingpro/portable-devtools · Team Ai