exceptions.py
This file
Path
httpcore/exceptions.py
116 lines · 1.9 KiB · Python
Last changed by
Updating docstringsTom Christiebefore adoption5f8000f
History of this fileTake it
1# Timeout exceptions...234class Timeout(Exception):5 """6 A base class for all timeouts.7 """8910class ConnectTimeout(Timeout):11 """12 Timeout while establishing a connection.13 """141516class ReadTimeout(Timeout):17 """18 Timeout while reading response data.19 """202122class WriteTimeout(Timeout):23 """24 Timeout while writing request data.25 """262728class PoolTimeout(Timeout):29 """30 Timeout while waiting to acquire a connection from the pool.31 """323334# HTTP exceptions...353637class ProtocolError(Exception):38 """39 Malformed HTTP.40 """414243class DecodingError(Exception):44 """45 Decoding of the response failed.46 """474849# Redirect exceptions...505152class RedirectError(Exception):53 """54 Base class for HTTP redirect errors.55 """565758class TooManyRedirects(RedirectError):59 """60 Too many redirects.61 """626364class RedirectBodyUnavailable(RedirectError):65 """66 Got a redirect response, but the request body was streaming, and is67 no longer available.68 """697071class RedirectLoop(RedirectError):72 """73 Infinite redirect loop.74 """757677# Stream exceptions...787980class StreamException(Exception):81 """82 The base class for stream exceptions.8384 The developer made an error in accessing the request stream in85 an invalid way.86 """878889class StreamConsumed(StreamException):90 """91 Attempted to read or stream response content, but the content has already92 been streamed.93 """949596class ResponseNotRead(StreamException):97 """98 Attempted to access response content, without having called `read()`99 after a streaming response.100 """101102103class ResponseClosed(StreamException):104 """105 Attempted to read or stream response content, but the request has been106 closed.107 """108109110# Other cases...111112113class InvalidURL(Exception):114 """115 URL was missing a hostname, or was not one of HTTP/HTTPS.116 """