Raised when the maximum number of retries is exceeded. :param pool: The connection pool :type pool: :class:`~urllib3.connectionpool.HTTPConnectionPool` :param str url: The requested Url :param reason: The underlying error :type reason: :class:`Exception`
| 82 | |
| 83 | |
| 84 | class MaxRetryError(RequestError): |
| 85 | """Raised when the maximum number of retries is exceeded. |
| 86 | |
| 87 | :param pool: The connection pool |
| 88 | :type pool: :class:`~urllib3.connectionpool.HTTPConnectionPool` |
| 89 | :param str url: The requested Url |
| 90 | :param reason: The underlying error |
| 91 | :type reason: :class:`Exception` |
| 92 | |
| 93 | """ |
| 94 | |
| 95 | def __init__( |
| 96 | self, pool: ConnectionPool, url: str | None, reason: Exception | None = None |
| 97 | ) -> None: |
| 98 | self.reason = reason |
| 99 | |
| 100 | message = f"Max retries exceeded with url: {url} (Caused by {reason!r})" |
| 101 | |
| 102 | super().__init__(pool, url, message) |
| 103 | |
| 104 | def __reduce__(self) -> _TYPE_REDUCE_RESULT: |
| 105 | # For pickling purposes. |
| 106 | return self.__class__, (None, self.url, self.reason) |
| 107 | |
| 108 | |
| 109 | class HostChangedError(RequestError): |
no outgoing calls