Skip to content
Myr

exceptions.py

This file

Path

httpcore/exceptions.py

66 lines · 1.1 KiB · Python

Last changed by

Wrap decoding errors with custom exceptionsYeray Diaz Diazbefore adoptionbdc218f

History of this file

Take it

StuffTom Christiebefore adoption30530d4

lines 1–24why, one step back
1class Timeout(Exception):
2 """3 A base class for all timeouts.4 """567class ConnectTimeout(Timeout):8 """9 Timeout while establishing a connection.10 """111213class ReadTimeout(Timeout):14 """15 Timeout while reading response data.16 """171819class PoolTimeout(Timeout):20 """21 Timeout while waiting to acquire a connection from the pool.22 """2324

Merge pull request #17 from encode/close-keepalive-connectionsTom Christiebefore adoption91a2a1b

line 25why, one step back
25class ProtocolError(Exception):

StuffTom Christiebefore adoption30530d4

line 26why, one step back
26 """

Merge pull request #17 from encode/close-keepalive-connectionsTom Christiebefore adoption91a2a1b

line 27why, one step back
27 Malformed HTTP.

StuffTom Christiebefore adoption30530d4

lines 28–42why, one step back
28 """
293031class StreamConsumed(Exception):32 """33 Attempted to read or stream response content, but the content has already34 been streamed.35 """363738class ResponseClosed(Exception):39 """40 Attempted to read or stream response content, but the request has been41 closed without loading the body.42 """

Wrap decoding errors with custom exceptionsYeray Diaz Diazbefore adoptionbdc218f

lines 43–66why, one step back
43
4445class DecodingError(Exception):46 """47 Decoding of the response failed.48 """495051class DeflateDecodingError(DecodingError):52 """53 Decoding of the response using deflate failed.54 """555657class GzipDecodingError(DecodingError):58 """59 Decoding of the response using gzip failed.60 """616263class BrotliDecodingError(DecodingError):64 """65 Decoding of the response using brotli failed.66 """