Exceptions¶
-
exception
urllib3.exceptions.BodyNotHttplibCompatible¶ Bases:
urllib3.exceptions.HTTPErrorBody should be
http.client.HTTPResponselike (have an fp attribute which returns raw chunks) for read_chunked().
-
exception
urllib3.exceptions.ClosedPoolError(pool, message)¶ Bases:
urllib3.exceptions.PoolErrorRaised when a request enters a pool after the pool has been closed.
-
exception
urllib3.exceptions.ConnectTimeoutError¶ Bases:
urllib3.exceptions.TimeoutErrorRaised when a socket timeout occurs while connecting to a server
-
urllib3.exceptions.ConnectionError¶ Renamed to ProtocolError but aliased for backwards compatibility.
alias of
urllib3.exceptions.ProtocolError
-
exception
urllib3.exceptions.DecodeError¶ Bases:
urllib3.exceptions.HTTPErrorRaised when automatic decoding based on Content-Type fails.
-
exception
urllib3.exceptions.DependencyWarning¶ Bases:
urllib3.exceptions.HTTPWarningWarned when an attempt is made to import a module with missing optional dependencies.
-
exception
urllib3.exceptions.EmptyPoolError(pool, message)¶ Bases:
urllib3.exceptions.PoolErrorRaised when a pool runs out of connections and no more are allowed.
-
exception
urllib3.exceptions.HeaderParsingError(defects, unparsed_data)¶ Bases:
urllib3.exceptions.HTTPErrorRaised by assert_header_parsing, but we convert it to a log.warning statement.
-
exception
urllib3.exceptions.HostChangedError(pool, url, retries=3)¶ Bases:
urllib3.exceptions.RequestErrorRaised when an existing pool gets a request for a foreign host.
-
exception
urllib3.exceptions.IncompleteRead(partial, expected)¶ Bases:
urllib3.exceptions.HTTPError,http.client.IncompleteReadResponse length doesn’t match expected Content-Length
Subclass of
http.client.IncompleteReadto allow int value forpartialto avoid creating large objects on streamed reads.
-
exception
urllib3.exceptions.InsecurePlatformWarning¶ Bases:
urllib3.exceptions.SecurityWarningWarned when certain TLS/SSL configuration is not available on a platform.
-
exception
urllib3.exceptions.InsecureRequestWarning¶ Bases:
urllib3.exceptions.SecurityWarningWarned when making an unverified HTTPS request.
-
exception
urllib3.exceptions.InvalidChunkLength(response, length)¶ Bases:
urllib3.exceptions.HTTPError,http.client.IncompleteReadInvalid chunk length in a chunked response.
-
exception
urllib3.exceptions.InvalidHeader¶ Bases:
urllib3.exceptions.HTTPErrorThe header provided was somehow invalid.
-
exception
urllib3.exceptions.LocationParseError(location)¶ Bases:
urllib3.exceptions.LocationValueErrorRaised when get_host or similar fails to parse the URL input.
-
exception
urllib3.exceptions.LocationValueError¶ Bases:
ValueError,urllib3.exceptions.HTTPErrorRaised when there is something wrong with a given URL input.
-
exception
urllib3.exceptions.MaxRetryError(pool, url, reason=None)¶ Bases:
urllib3.exceptions.RequestErrorRaised when the maximum number of retries is exceeded.
- Parameters
pool (
HTTPConnectionPool) – The connection poolurl (string) – The requested Url
reason (exceptions.Exception) – The underlying error
-
exception
urllib3.exceptions.NewConnectionError(pool, message)¶ Bases:
urllib3.exceptions.ConnectTimeoutError,urllib3.exceptions.PoolErrorRaised when we fail to establish a new connection. Usually ECONNREFUSED.
-
exception
urllib3.exceptions.PoolError(pool, message)¶ Bases:
urllib3.exceptions.HTTPErrorBase exception for errors caused within a pool.
-
exception
urllib3.exceptions.ProtocolError¶ Bases:
urllib3.exceptions.HTTPErrorRaised when something unexpected happens mid-request/response.
-
exception
urllib3.exceptions.ProxyError(message, error, *args)¶ Bases:
urllib3.exceptions.HTTPErrorRaised when the connection to a proxy fails.
-
exception
urllib3.exceptions.ProxySchemeUnknown(scheme)¶ Bases:
AssertionError,urllib3.exceptions.URLSchemeUnknownProxyManager does not support the supplied scheme
-
exception
urllib3.exceptions.ProxySchemeUnsupported¶ Bases:
ValueErrorFetching HTTPS resources through HTTPS proxies is unsupported
-
exception
urllib3.exceptions.ReadTimeoutError(pool, url, message)¶ Bases:
urllib3.exceptions.TimeoutError,urllib3.exceptions.RequestErrorRaised when a socket timeout occurs while receiving data from a server
-
exception
urllib3.exceptions.RequestError(pool, url, message)¶ Bases:
urllib3.exceptions.PoolErrorBase exception for PoolErrors that have associated URLs.
-
exception
urllib3.exceptions.ResponseError¶ Bases:
urllib3.exceptions.HTTPErrorUsed as a container for an error reason supplied in a MaxRetryError.
-
GENERIC_ERROR= 'too many error responses'¶
-
SPECIFIC_ERROR= 'too many {status_code} error responses'¶
-
-
exception
urllib3.exceptions.ResponseNotChunked¶ Bases:
urllib3.exceptions.ProtocolError,ValueErrorResponse needs to be chunked in order to read it as chunks.
-
exception
urllib3.exceptions.SNIMissingWarning¶ Bases:
urllib3.exceptions.HTTPWarningWarned when making a HTTPS request without SNI available.
-
exception
urllib3.exceptions.SSLError¶ Bases:
urllib3.exceptions.HTTPErrorRaised when SSL certificate fails in an HTTPS connection.
-
exception
urllib3.exceptions.SecurityWarning¶ Bases:
urllib3.exceptions.HTTPWarningWarned when performing security reducing actions
-
exception
urllib3.exceptions.SubjectAltNameWarning¶ Bases:
urllib3.exceptions.SecurityWarningWarned when connecting to a host with a certificate missing a SAN.
-
exception
urllib3.exceptions.SystemTimeWarning¶ Bases:
urllib3.exceptions.SecurityWarningWarned when system time is suspected to be wrong
-
exception
urllib3.exceptions.TimeoutError¶ Bases:
urllib3.exceptions.HTTPErrorRaised when a socket timeout error occurs.
Catching this error will catch both
ReadTimeoutErrorsandConnectTimeoutErrors.
-
exception
urllib3.exceptions.TimeoutStateError¶ Bases:
urllib3.exceptions.HTTPErrorRaised when passing an invalid state to a timeout
-
exception
urllib3.exceptions.URLSchemeUnknown(scheme)¶ Bases:
urllib3.exceptions.LocationValueErrorRaised when a URL input has an unsupported scheme.
-
exception
urllib3.exceptions.UnrewindableBodyError¶ Bases:
urllib3.exceptions.HTTPErrorurllib3 encountered an error when trying to rewind a body