Skip to content
Myr

exceptions.py

This file

Path

httpcore/exceptions.py

97 lines · 1.5 KiB · Python

Last changed by

Rejig test and tighten up models APITom Christiebefore adoptiondea4d42

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–45why, one step back
34# HTTP exceptions...
353637class ProtocolError(Exception):38 """39 Malformed HTTP.40 """414243# Redirect exceptions...4445

Merge pull request #23 from encode/adaptersTom Christiebefore adoption696c054

lines 46–70why, one step back
46class 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 """6970

Rejig test and tighten up models APITom Christiebefore adoptiondea4d42

line 71why, one step back
71# Response exceptions...

StuffTom Christiebefore adoption30530d4

lines 72–84why, one step back
72
7374class StreamConsumed(Exception):75 """76 Attempted to read or stream response content, but the content has already77 been streamed.78 """798081class ResponseClosed(Exception):82 """83 Attempted to read or stream response content, but the request has been84 closed without loading the body.

Merge pull request #23 from encode/adaptersTom Christiebefore adoption696c054

lines 85–87why, one step back
85 """
8687

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

lines 88–92why, one step back
88class DecodingError(Exception):
89 """90 Decoding of the response failed.91 """92

response.next()Tom Christiebefore adoptiond652479

line 93why, one step back
93

Merge pull request #23 from encode/adaptersTom Christiebefore adoption696c054

lines 94–95why, one step back
94class InvalidURL(Exception):
95 """

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

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

StuffTom Christiebefore adoption30530d4

line 97why, one step back
97 """