Skip to content
Myr

Capture and re-raise urllib3 ProtocolError

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

authored by Ian Cordasco · committed by Ian Cordasco · parent 95161ed · Browse files · 1 file+4 added−0 removed
This commit

State

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

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:requests/adapters.py+4 added
21 unmodified lines
22from .packages.urllib3.exceptions import ConnectTimeoutError23from .packages.urllib3.exceptions import HTTPError as _HTTPError24from .packages.urllib3.exceptions import MaxRetryError25from .packages.urllib3.exceptions import ProxyError as _ProxyError26from .packages.urllib3.exceptions import ProtocolError27from .packages.urllib3.exceptions import ReadTimeoutError28from .packages.urllib3.exceptions import SSLError as _SSLError29from .cookies import extract_cookies_to_jar30from .exceptions import (ConnectionError, ConnectTimeout, ReadTimeout, SSLError,
372 unmodified lines
403404 except socket.error as sockerr:405 raise ConnectionError(sockerr, request=request)406407 except ProtocolError as e:408 raise ConnectionError(e, request=request)409410 except MaxRetryError as e:411 if isinstance(e.reason, ConnectTimeoutError):412 raise ConnectTimeout(e, request=request)413
14 unmodified lines