exceptions

This module contains the set of Requests’ exceptions.

Module Contents

Classes

RequestException(self,*args,**kwargs) There was an ambiguous exception that occurred while handling your
HTTPError() An HTTP error occurred.
ConnectionError() A Connection error occurred.
ProxyError() A proxy error occurred.
SSLError() An SSL error occurred.
Timeout() The request timed out.
ConnectTimeout() The request timed out while trying to connect to the remote server.
ReadTimeout() The server did not send any data in the allotted amount of time.
URLRequired() A valid URL is required to make a request.
TooManyRedirects() Too many redirects.
MissingSchema() The URL schema (e.g. http or https) is missing.
InvalidSchema() See defaults.py for valid schemas.
InvalidURL() The URL provided was somehow invalid.
ChunkedEncodingError() The server declared chunked encoding but sent an invalid chunk.
ContentDecodingError() Failed to decode response content
StreamConsumedError() The content for this response was already consumed
RetryError() Custom retries logic failed
RequestsWarning() Base warning for Requests.
FileModeWarning() A file was opened in text mode, but Requests determined its binary length.
class RequestException(*args, **kwargs)

There was an ambiguous exception that occurred while handling your request.

__init__(*args, **kwargs)

Initialize RequestException with request and response objects.

class HTTPError

An HTTP error occurred.

class ConnectionError

A Connection error occurred.

class ProxyError

A proxy error occurred.

class SSLError

An SSL error occurred.

class Timeout

The request timed out.

Catching this error will catch both ConnectTimeout and ReadTimeout errors.

class ConnectTimeout

The request timed out while trying to connect to the remote server.

Requests that produced this error are safe to retry.

class ReadTimeout

The server did not send any data in the allotted amount of time.

class URLRequired

A valid URL is required to make a request.

class TooManyRedirects

Too many redirects.

class MissingSchema

The URL schema (e.g. http or https) is missing.

class InvalidSchema

See defaults.py for valid schemas.

class InvalidURL

The URL provided was somehow invalid.

class ChunkedEncodingError

The server declared chunked encoding but sent an invalid chunk.

class ContentDecodingError

Failed to decode response content

class StreamConsumedError

The content for this response was already consumed

class RetryError

Custom retries logic failed

class RequestsWarning

Base warning for Requests.

class FileModeWarning

A file was opened in text mode, but Requests determined its binary length.