Coverage for requests.packages.urllib3.exceptions : 65%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# urllib3/exceptions.py # Copyright 2008-2013 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
"Base exception used by this module."
"Base exception for errors caused within a pool." self.pool = pool HTTPError.__init__(self, "%s: %s" % (pool, message))
# For pickling purposes. return self.__class__, (None, None)
"Base exception for PoolErrors that have associated URLs." self.url = url PoolError.__init__(self, pool, message)
# For pickling purposes. return self.__class__, (None, self.url, None)
"Raised when SSL certificate fails in an HTTPS connection."
"Raised when the connection to a proxy fails."
"Raised when a normal connection fails."
"Raised when automatic decoding based on Content-Type fails."
## Leaf Exceptions
"Raised when the maximum number of retries is exceeded."
self.reason = reason
message = "Max retries exceeded with url: %s" % url if reason: message += " (Caused by %s: %s)" % (type(reason), reason) else: message += " (Caused by redirect)"
RequestError.__init__(self, pool, url, message)
"Raised when an existing pool gets a request for a foreign host."
message = "Tried to open a foreign host with url: %s" % url RequestError.__init__(self, pool, url, message) self.retries = retries
""" Raised when passing an invalid state to a timeout """
""" Raised when a socket timeout error occurs.
Catching this error will catch both :exc:`ReadTimeoutErrors <ReadTimeoutError>` and :exc:`ConnectTimeoutErrors <ConnectTimeoutError>`. """
"Raised when a socket timeout occurs while receiving data from a server"
# This timeout error does not have a URL attached and needs to inherit from the # base HTTPError "Raised when a socket timeout occurs while connecting to a server"
"Raised when a pool runs out of connections and no more are allowed."
"Raised when a request enters a pool after the pool has been closed."
"Raised when get_host or similar fails to parse the URL input."
message = "Failed to parse: %s" % location HTTPError.__init__(self, message)
self.location = location |