diff options
author | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:41:29 -0700 |
---|---|---|
committer | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:41:29 -0700 |
commit | 224200a9815f792f93632d03a38e4f0763ae69ef (patch) | |
tree | 161977259a7d8aa262aab60d7c8fce757ad3bb0f /requests/packages/urllib3/exceptions.py | |
parent | 653256249d44c67a0852d57a166948a9dc712ef4 (diff) | |
download | python-requests-224200a9815f792f93632d03a38e4f0763ae69ef.tar python-requests-224200a9815f792f93632d03a38e4f0763ae69ef.tar.gz |
Imported Upstream version 2.0.0
Diffstat (limited to 'requests/packages/urllib3/exceptions.py')
-rw-r--r-- | requests/packages/urllib3/exceptions.py | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/requests/packages/urllib3/exceptions.py b/requests/packages/urllib3/exceptions.py index 2e2a259..98ef9ab 100644 --- a/requests/packages/urllib3/exceptions.py +++ b/requests/packages/urllib3/exceptions.py @@ -39,6 +39,11 @@ class SSLError(HTTPError): pass +class ProxyError(HTTPError): + "Raised when the connection to a proxy fails." + pass + + class DecodeError(HTTPError): "Raised when automatic decoding based on Content-Type fails." pass @@ -70,8 +75,29 @@ class HostChangedError(RequestError): self.retries = retries -class TimeoutError(RequestError): - "Raised when a socket timeout occurs." +class TimeoutStateError(HTTPError): + """ Raised when passing an invalid state to a timeout """ + pass + + +class TimeoutError(HTTPError): + """ Raised when a socket timeout error occurs. + + Catching this error will catch both :exc:`ReadTimeoutErrors + <ReadTimeoutError>` and :exc:`ConnectTimeoutErrors <ConnectTimeoutError>`. + """ + pass + + +class ReadTimeoutError(TimeoutError, RequestError): + "Raised when a socket timeout occurs while receiving data from a server" + pass + + +# This timeout error does not have a URL attached and needs to inherit from the +# base HTTPError +class ConnectTimeoutError(TimeoutError): + "Raised when a socket timeout occurs while connecting to a server" pass |