Skip to content
Myr

Translate urllib3 ProxyError into a requests ProxyError derived from ConnectionError.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Graham Dumpleton · committed by Graham Dumpleton · parent 9968a10 · Browse files · 2 files+9 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+9 added−1 removed

  • other:+9 added−1 removed

2 files+9 added−1 removed

modified:requests/adapters.py+5 added-1 removed
20 unmodified lines
21from .packages.urllib3.exceptions import MaxRetryError22from .packages.urllib3.exceptions import TimeoutError23from .packages.urllib3.exceptions import SSLError as _SSLError24from .packages.urllib3.exceptions import HTTPError as _HTTPError25from .packages.urllib3.exceptions import ProxyError as _ProxyError26from .cookies import extract_cookies_to_jar26from .exceptions import ConnectionError, Timeout, SSLError27from .exceptions import ConnectionError, Timeout, SSLError, ProxyError28from .auth import _basic_auth_str2930DEFAULT_POOLBLOCK = False31DEFAULT_POOLSIZE = 10
321 unmodified lines
353354 except MaxRetryError as e:355 raise ConnectionError(e)356357 except _ProxyError as e:358 raise ProxyError(e)359360 except (_SSLError, _HTTPError) as e:361 if isinstance(e, _SSLError):362 raise SSLError(e)363 elif isinstance(e, TimeoutError):
10 unmodified lines
modified:requests/exceptions.py+4 added
25 unmodified lines
26class ConnectionError(RequestException):27 """A Connection error occurred."""282930class ProxyError(ConnectionError):31 """A proxy error occurred."""323334class SSLError(ConnectionError):35 """An SSL error occurred."""3637
26 unmodified lines