Exceptions¶
We try to follow the requests exception hirearchy, however, some are missing, while some are added.
If an exception is marked as “not used”, please catch the base exception.
Exceptions¶
- class curl_cffi.requests.exceptions.RequestException(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
Base exception for curl_cffi.requests package
- class curl_cffi.requests.exceptions.CookieConflict(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
Same cookie exists for different domains.
- class curl_cffi.requests.exceptions.SessionClosed(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The session has already been closed.
- class curl_cffi.requests.exceptions.ImpersonateError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The impersonate config was wrong or impersonate failed.
- class curl_cffi.requests.exceptions.InvalidJSONError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
A JSON error occurred. not used
- class curl_cffi.requests.exceptions.HTTPError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
An HTTP error occurred.
- class curl_cffi.requests.exceptions.IncompleteRead(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
Incomplete read of content
- class curl_cffi.requests.exceptions.ConnectionError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
A Connection error occurred.
- class curl_cffi.requests.exceptions.DNSError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
Could not resolve
- class curl_cffi.requests.exceptions.ProxyError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
A proxy error occurred.
- class curl_cffi.requests.exceptions.SSLError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
An SSL error occurred.
- class curl_cffi.requests.exceptions.CertificateVerifyError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
Raised when certificate validated has failed
- class curl_cffi.requests.exceptions.Timeout(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The request timed out.
- class curl_cffi.requests.exceptions.ConnectTimeout(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The request timed out while trying to connect to the remote server.
Requests that produced this error are safe to retry.
not used
- class curl_cffi.requests.exceptions.ReadTimeout(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The server did not send any data in the allotted amount of time. not used
- class curl_cffi.requests.exceptions.URLRequired(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
A valid URL is required to make a request. not used
- class curl_cffi.requests.exceptions.TooManyRedirects(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
Too many redirects.
- class curl_cffi.requests.exceptions.MissingSchema(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The URL scheme (e.g. http or https) is missing. not used
- class curl_cffi.requests.exceptions.InvalidSchema(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The URL scheme provided is either invalid or unsupported. not used
- class curl_cffi.requests.exceptions.InvalidURL(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The URL provided was somehow invalid.
- class curl_cffi.requests.exceptions.InvalidHeader(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The header value provided was somehow invalid. not used
- class curl_cffi.requests.exceptions.InvalidProxyURL(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The proxy URL provided is invalid. not used
- class curl_cffi.requests.exceptions.ChunkedEncodingError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The server declared chunked encoding but sent an invalid chunk. not used
- class curl_cffi.requests.exceptions.ContentDecodingError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
Failed to decode response content. not used
- class curl_cffi.requests.exceptions.StreamConsumedError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
The content for this response was already consumed. not used
- class curl_cffi.requests.exceptions.RetryError(msg, code: CurlECode | Literal[0] = 0, response=None, *args, **kwargs)[source]¶
Custom retries logic failed. not used