MCPcopy
hub / github.com/urllib3/urllib3 / MaxRetryError

Class MaxRetryError

src/urllib3/exceptions.py:84–106  ·  view source on GitHub ↗

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`

Source from the content-addressed store, hash-verified

82
83
84class 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
109class HostChangedError(RequestError):

Callers 2

incrementMethod · 0.85

Calls

no outgoing calls

Tested by 1