MCPcopy
hub / github.com/urllib3/urllib3 / NewConnectionError

Class NewConnectionError

src/urllib3/exceptions.py:142–163  ·  view source on GitHub ↗

Raised when we fail to establish a new connection. Usually ECONNREFUSED.

Source from the content-addressed store, hash-verified

140
141
142class NewConnectionError(ConnectTimeoutError, HTTPError):
143 """Raised when we fail to establish a new connection. Usually ECONNREFUSED."""
144
145 def __init__(self, conn: HTTPConnection, message: str) -> None:
146 self.conn = conn
147 self._message = message
148 super().__init__(f"{conn}: {message}")
149
150 def __reduce__(self) -> _TYPE_REDUCE_RESULT:
151 # For pickling purposes.
152 return self.__class__, (None, self._message)
153
154 @property
155 def pool(self) -> HTTPConnection:
156 warnings.warn(
157 "The 'pool' property is deprecated and will be removed "
158 "in urllib3 v3.0. Use 'conn' instead.",
159 FutureWarning,
160 stacklevel=2,
161 )
162
163 return self.conn
164
165
166class NameResolutionError(NewConnectionError):

Callers 3

_new_connMethod · 0.85
_new_connMethod · 0.85

Calls

no outgoing calls