exceptions.py
This file
Path
httpcore/exceptions.py
122 lines · 1.9 KiB · Python
Last changed by
Add `HttpError`Matus Ferechbefore adoption2197015
History of this fileTake it
Rejig test and tighten up models APITom Christiebefore adoptiondea4d42
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 pull request #23 from encode/adaptersTom Christiebefore adoption696c054
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 """3233Rejig test and tighten up models APITom Christiebefore adoptiondea4d42
lines 34–36why, one step back34# HTTP exceptions...3536Add `HttpError`Matus Ferechbefore adoption2197015
lines 37–42why, one step back37class HttpError(Exception):38 """39 An Http error occurred.40 """4142Rejig test and tighten up models APITom Christiebefore adoptiondea4d42
lines 43–48why, one step back43class ProtocolError(Exception):44 """45 Malformed HTTP.46 """4748Updating docstringsTom Christiebefore adoption5f8000f
lines 49–54why, one step back49class DecodingError(Exception):50 """51 Decoding of the response failed.52 """5354Rejig test and tighten up models APITom Christiebefore adoptiondea4d42
lines 55–57why, one step back55# Redirect exceptions...5657Merge pull request #23 from encode/adaptersTom Christiebefore adoption696c054
lines 58–82why, one step back58class RedirectError(Exception):59 """60 Base class for HTTP redirect errors.61 """626364class TooManyRedirects(RedirectError):65 """66 Too many redirects.67 """686970class RedirectBodyUnavailable(RedirectError):71 """72 Got a redirect response, but the request body was streaming, and is73 no longer available.74 """757677class RedirectLoop(RedirectError):78 """79 Infinite redirect loop.80 """8182Updating docstringsTom Christiebefore adoption5f8000f
line 83why, one step back83# Stream exceptions...StuffTom Christiebefore adoption30530d4
lines 84–85why, one step back8485Updating docstringsTom Christiebefore adoption5f8000f
line 86why, one step back86class StreamException(Exception):StuffTom Christiebefore adoption30530d4
line 87why, one step back87 """Updating docstringsTom Christiebefore adoption5f8000f
lines 88–96why, one step back88 The base class for stream exceptions.8990 The developer made an error in accessing the request stream in91 an invalid way.92 """939495class StreamConsumed(StreamException):96 """StuffTom Christiebefore adoption30530d4
lines 97–101why, one step back97 Attempted to read or stream response content, but the content has already98 been streamed.99 """100101Updating docstringsTom Christiebefore adoption5f8000f
line 102why, one step back102class ResponseNotRead(StreamException):Response.contentTom Christiebefore adoption4c55113
lines 103–108why, one step back103 """104 Attempted to access response content, without having called `read()`105 after a streaming response.106 """107108Updating docstringsTom Christiebefore adoption5f8000f
line 109why, one step back109class ResponseClosed(StreamException):StuffTom Christiebefore adoption30530d4
lines 110–111why, one step back110 """111 Attempted to read or stream response content, but the request has beenUpdating docstringsTom Christiebefore adoption5f8000f
line 112why, one step back112 closed.Merge pull request #20 from yeraydiazdiaz/decoding-exceptionsTom Christiebefore adoption2b134a6
line 113why, one step back113 """Response.contentTom Christiebefore adoption4c55113
lines 114–116why, one step back114115116# Other cases...Merge pull request #20 from yeraydiazdiaz/decoding-exceptionsTom Christiebefore adoption2b134a6
line 117why, one step back117response.next()Tom Christiebefore adoptiond652479
line 118why, one step back118Merge pull request #23 from encode/adaptersTom Christiebefore adoption696c054
lines 119–120why, one step back119class InvalidURL(Exception):120 """Merge pull request #20 from yeraydiazdiaz/decoding-exceptionsTom Christiebefore adoption2b134a6
line 121why, one step back121 URL was missing a hostname, or was not one of HTTP/HTTPS.StuffTom Christiebefore adoption30530d4
line 122why, one step back122 """