Skip to content
Myr

exceptions.py

This file

Path

httpcore/exceptions.py

116 lines · 1.9 KiB · Python

Last changed by

Updating docstringsTom Christiebefore adoption5f8000f

History of this file

Take it

Rejig test and tighten up models APITom Christiebefore adoptiondea4d42

lines 1–3why, one step back
1# Timeout exceptions...
23

StuffTom Christiebefore adoption30530d4

lines 4–21why, one step back
4class 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 """2021

Merge pull request #23 from encode/adaptersTom Christiebefore adoption696c054

lines 22–27why, one step back
22class WriteTimeout(Timeout):
23 """24 Timeout while writing request data.25 """2627

StuffTom Christiebefore adoption30530d4

lines 28–33why, one step back
28class PoolTimeout(Timeout):
29 """30 Timeout while waiting to acquire a connection from the pool.31 """3233

Rejig test and tighten up models APITom Christiebefore adoptiondea4d42

lines 34–42why, one step back
34# HTTP exceptions...
353637class ProtocolError(Exception):38 """39 Malformed HTTP.40 """4142

Updating docstringsTom Christiebefore adoption5f8000f

lines 43–48why, one step back
43class DecodingError(Exception):
44 """45 Decoding of the response failed.46 """4748

Rejig test and tighten up models APITom Christiebefore adoptiondea4d42

lines 49–51why, one step back
49# Redirect exceptions...
5051

Merge pull request #23 from encode/adaptersTom Christiebefore adoption696c054

lines 52–76why, one step back
52class 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 """7576

Updating docstringsTom Christiebefore adoption5f8000f

line 77why, one step back
77# Stream exceptions...

StuffTom Christiebefore adoption30530d4

lines 78–79why, one step back
78
79

Updating docstringsTom Christiebefore adoption5f8000f

line 80why, one step back
80class StreamException(Exception):

StuffTom Christiebefore adoption30530d4

line 81why, one step back
81 """

Updating docstringsTom Christiebefore adoption5f8000f

lines 82–90why, one step back
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 """

StuffTom Christiebefore adoption30530d4

lines 91–95why, one step back
91 Attempted to read or stream response content, but the content has already
92 been streamed.93 """9495

Updating docstringsTom Christiebefore adoption5f8000f

line 96why, one step back
96class ResponseNotRead(StreamException):

Response.contentTom Christiebefore adoption4c55113

lines 97–102why, one step back
97 """
98 Attempted to access response content, without having called `read()`99 after a streaming response.100 """101102

Updating docstringsTom Christiebefore adoption5f8000f

line 103why, one step back
103class ResponseClosed(StreamException):

StuffTom Christiebefore adoption30530d4

lines 104–105why, one step back
104 """
105 Attempted to read or stream response content, but the request has been

Updating docstringsTom Christiebefore adoption5f8000f

line 106why, one step back
106 closed.

Merge pull request #20 from yeraydiazdiaz/decoding-exceptionsTom Christiebefore adoption2b134a6

line 107why, one step back
107 """

Response.contentTom Christiebefore adoption4c55113

lines 108–110why, one step back
108
109110# Other cases...

Merge pull request #20 from yeraydiazdiaz/decoding-exceptionsTom Christiebefore adoption2b134a6

line 111why, one step back
111

response.next()Tom Christiebefore adoptiond652479

line 112why, one step back
112

Merge pull request #23 from encode/adaptersTom Christiebefore adoption696c054

lines 113–114why, one step back
113class InvalidURL(Exception):
114 """

Merge pull request #20 from yeraydiazdiaz/decoding-exceptionsTom Christiebefore adoption2b134a6

line 115why, one step back
115 URL was missing a hostname, or was not one of HTTP/HTTPS.

StuffTom Christiebefore adoption30530d4

line 116why, one step back
116 """