packages.urllib3.exceptions

Module Contents

Classes

HTTPError() “Base exception used by this module.”
HTTPWarning() “Base warning used by this module.”
PoolError(self,pool,message) “Base exception for errors caused within a pool.”
RequestError(self,pool,url,message) “Base exception for PoolErrors that have associated URLs.”
SSLError() “Raised when SSL certificate fails in an HTTPS connection.”
ProxyError() “Raised when the connection to a proxy fails.”
DecodeError() “Raised when automatic decoding based on Content-Type fails.”
ProtocolError() “Raised when something unexpected happens mid-request/response.”
MaxRetryError(self,pool,url,reason=None) Raised when the maximum number of retries is exceeded.
HostChangedError(self,pool,url,retries=3) “Raised when an existing pool gets a request for a foreign host.”
TimeoutStateError() Raised when passing an invalid state to a timeout
TimeoutError() Raised when a socket timeout error occurs.
ReadTimeoutError() “Raised when a socket timeout occurs while receiving data from a server”
ConnectTimeoutError() “Raised when a socket timeout occurs while connecting to a server”
NewConnectionError() “Raised when we fail to establish a new connection. Usually ECONNREFUSED.”
EmptyPoolError() “Raised when a pool runs out of connections and no more are allowed.”
ClosedPoolError() “Raised when a request enters a pool after the pool has been closed.”
LocationValueError() “Raised when there is something wrong with a given URL input.”
LocationParseError(self,location) “Raised when get_host or similar fails to parse the URL input.”
ResponseError() “Used as a container for an error reason supplied in a MaxRetryError.”
SecurityWarning() “Warned when perfoming security reducing actions”
SubjectAltNameWarning() “Warned when connecting to a host with a certificate missing a SAN.”
InsecureRequestWarning() “Warned when making an unverified HTTPS request.”
SystemTimeWarning() “Warned when system time is suspected to be wrong”
InsecurePlatformWarning() “Warned when certain SSL configuration is not available on a platform.”
SNIMissingWarning() “Warned when making a HTTPS request without SNI available.”
ResponseNotChunked() “Response needs to be chunked in order to read it as chunks.”
ProxySchemeUnknown(self,scheme) “ProxyManager does not support the supplied scheme”
HeaderParsingError(self,defects,unparsed_data) “Raised by assert_header_parsing, but we convert it to a log.warning statement.”
class HTTPError

“Base exception used by this module.”

class HTTPWarning

“Base warning used by this module.”

class PoolError(pool, message)

“Base exception for errors caused within a pool.”

__init__(pool, message)
__reduce__()
class RequestError(pool, url, message)

“Base exception for PoolErrors that have associated URLs.”

__init__(pool, url, message)
__reduce__()
class SSLError

“Raised when SSL certificate fails in an HTTPS connection.”

class ProxyError

“Raised when the connection to a proxy fails.”

class DecodeError

“Raised when automatic decoding based on Content-Type fails.”

class ProtocolError

“Raised when something unexpected happens mid-request/response.”

class MaxRetryError(pool, url, reason=None)

Raised when the maximum number of retries is exceeded.

Parameters:
  • pool (HTTPConnectionPool) – The connection pool
  • url (string) – The requested Url
  • reason (exceptions.Exception) – The underlying error
__init__(pool, url, reason=None)
class HostChangedError(pool, url, retries=3)

“Raised when an existing pool gets a request for a foreign host.”

__init__(pool, url, retries=3)
class TimeoutStateError

Raised when passing an invalid state to a timeout

class TimeoutError

Raised when a socket timeout error occurs.

Catching this error will catch both ReadTimeoutErrors and ConnectTimeoutErrors.

class ReadTimeoutError

“Raised when a socket timeout occurs while receiving data from a server”

class ConnectTimeoutError

“Raised when a socket timeout occurs while connecting to a server”

class NewConnectionError

“Raised when we fail to establish a new connection. Usually ECONNREFUSED.”

class EmptyPoolError

“Raised when a pool runs out of connections and no more are allowed.”

class ClosedPoolError

“Raised when a request enters a pool after the pool has been closed.”

class LocationValueError

“Raised when there is something wrong with a given URL input.”

class LocationParseError(location)

“Raised when get_host or similar fails to parse the URL input.”

__init__(location)
class ResponseError

“Used as a container for an error reason supplied in a MaxRetryError.”

class SecurityWarning

“Warned when perfoming security reducing actions”

class SubjectAltNameWarning

“Warned when connecting to a host with a certificate missing a SAN.”

class InsecureRequestWarning

“Warned when making an unverified HTTPS request.”

class SystemTimeWarning

“Warned when system time is suspected to be wrong”

class InsecurePlatformWarning

“Warned when certain SSL configuration is not available on a platform.”

class SNIMissingWarning

“Warned when making a HTTPS request without SNI available.”

class ResponseNotChunked

“Response needs to be chunked in order to read it as chunks.”

class ProxySchemeUnknown(scheme)

“ProxyManager does not support the supplied scheme”

__init__(scheme)
class HeaderParsingError(defects, unparsed_data)

“Raised by assert_header_parsing, but we convert it to a log.warning statement.”

__init__(defects, unparsed_data)