diff options
author | k clair <kclair@riseup.net> | 2012-10-09 13:15:53 -0700 |
---|---|---|
committer | k clair <kclair@riseup.net> | 2012-10-09 13:15:53 -0700 |
commit | 3a56a2602da03da0df62602d1e14f407270096bb (patch) | |
tree | e06a077dfefc89df7c6630c676581a29b8e15d8b /requests-0.14.0/build/lib.linux-x86_64-2.6/requests/packages/urllib3/exceptions.py | |
parent | 568720334aa630ea504b2ce3b8c324f0a557d6e6 (diff) |
add previously generated debian packaging files
Diffstat (limited to 'requests-0.14.0/build/lib.linux-x86_64-2.6/requests/packages/urllib3/exceptions.py')
-rw-r--r-- | requests-0.14.0/build/lib.linux-x86_64-2.6/requests/packages/urllib3/exceptions.py | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/requests-0.14.0/build/lib.linux-x86_64-2.6/requests/packages/urllib3/exceptions.py b/requests-0.14.0/build/lib.linux-x86_64-2.6/requests/packages/urllib3/exceptions.py new file mode 100644 index 0000000..99ebb67 --- /dev/null +++ b/requests-0.14.0/build/lib.linux-x86_64-2.6/requests/packages/urllib3/exceptions.py @@ -0,0 +1,77 @@ +# urllib3/exceptions.py +# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) +# +# This module is part of urllib3 and is released under +# the MIT License: http://www.opensource.org/licenses/mit-license.php + + +## Base Exceptions + +class HTTPError(Exception): + "Base exception used by this module." + pass + + +class PoolError(HTTPError): + "Base exception for errors caused within a pool." + def __init__(self, pool, message): + self.pool = pool + HTTPError.__init__(self, "%s: %s" % (pool, message)) + + +class SSLError(HTTPError): + "Raised when SSL certificate fails in an HTTPS connection." + pass + + +class DecodeError(HTTPError): + "Raised when automatic decoding based on Content-Type fails." + pass + + +## Leaf Exceptions + +class MaxRetryError(PoolError): + "Raised when the maximum number of retries is exceeded." + + def __init__(self, pool, url): + message = "Max retries exceeded with url: %s" % url + PoolError.__init__(self, pool, message) + + self.url = url + + +class HostChangedError(PoolError): + "Raised when an existing pool gets a request for a foreign host." + + def __init__(self, pool, url, retries=3): + message = "Tried to open a foreign host with url: %s" % url + PoolError.__init__(self, pool, message) + + self.url = url + self.retries = retries + + +class TimeoutError(PoolError): + "Raised when a socket timeout occurs." + pass + + +class EmptyPoolError(PoolError): + "Raised when a pool runs out of connections and no more are allowed." + pass + + +class ClosedPoolError(PoolError): + "Raised when a request enters a pool after the pool has been closed." + pass + + +class LocationParseError(ValueError, HTTPError): + "Raised when get_host or similar fails to parse the URL input." + + def __init__(self, location): + message = "Failed to parse: %s" % location + super(LocationParseError, self).__init__(self, message) + + self.location = location |