exceptions.py
This file
Path
httpcore/exceptions.py
107 lines · 1.7 KiB · Python
Last changed by
Merge branch 'master' into wait-for-connection-closeTom Christiebefore adoption20bc1f3
History of this fileTake it
Merge branch 'master' into wait-for-connection-closeTom Christiebefore adoption20bc1f3
lines 1–3why, one step back1# Timeout exceptions...23StuffTom Christiebefore adoption30530d4
lines 4–21why, one step back4class 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 """2021Merge branch 'master' into wait-for-connection-closeTom Christiebefore adoption20bc1f3
lines 22–27why, one step back22class WriteTimeout(Timeout):23 """24 Timeout while writing request data.25 """2627StuffTom Christiebefore adoption30530d4
lines 28–33why, one step back28class PoolTimeout(Timeout):29 """30 Timeout while waiting to acquire a connection from the pool.31 """3233Merge branch 'master' into wait-for-connection-closeTom Christiebefore adoption20bc1f3
lines 34–36why, one step back34# HTTP exceptions...3536Merge pull request #17 from encode/close-keepalive-connectionsTom Christiebefore adoption91a2a1b
line 37why, one step back37class ProtocolError(Exception):StuffTom Christiebefore adoption30530d4
line 38why, one step back38 """Merge pull request #17 from encode/close-keepalive-connectionsTom Christiebefore adoption91a2a1b
line 39why, one step back39 Malformed HTTP.StuffTom Christiebefore adoption30530d4
lines 40–42why, one step back40 """4142Merge branch 'master' into wait-for-connection-closeTom Christiebefore adoption20bc1f3
lines 43–73why, one step back43# Redirect exceptions...444546class RedirectError(Exception):47 """48 Base class for HTTP redirect errors.49 """505152class TooManyRedirects(RedirectError):53 """54 Too many redirects.55 """565758class RedirectBodyUnavailable(RedirectError):59 """60 Got a redirect response, but the request body was streaming, and is61 no longer available.62 """636465class RedirectLoop(RedirectError):66 """67 Infinite redirect loop.68 """697071# Response exceptions...7273StuffTom Christiebefore adoption30530d4
lines 74–80why, one step back74class StreamConsumed(Exception):75 """76 Attempted to read or stream response content, but the content has already77 been streamed.78 """7980Merge branch 'master' into wait-for-connection-closeTom Christiebefore adoption20bc1f3
lines 81–87why, one step back81class ResponseNotRead(Exception):82 """83 Attempted to access response content, without having called `read()`84 after a streaming response.85 """8687StuffTom Christiebefore adoption30530d4
lines 88–91why, one step back88class ResponseClosed(Exception):89 """90 Attempted to read or stream response content, but the request has been91 closed without loading the body.Merge branch 'master' into wait-for-connection-closeTom Christiebefore adoption20bc1f3
lines 92–106why, one step back92 """939495class DecodingError(Exception):96 """97 Decoding of the response failed.98 """99100101# Other cases...102103104class InvalidURL(Exception):105 """106 URL was missing a hostname, or was not one of HTTP/HTTPS.StuffTom Christiebefore adoption30530d4
line 107why, one step back107 """