1# All exceptions raised here derive from HttpLib2Error
2class HttpLib2Error(Exception):
3 pass
4
5
6# Some exceptions can be caught and optionally
7# be turned back into responses.
8class HttpLib2ErrorWithResponse(HttpLib2Error):
9 def __init__(self, desc, response, content):
10 self.response = response
11 self.content = content
12 HttpLib2Error.__init__(self, desc)
13
14
15class RedirectMissingLocation(HttpLib2ErrorWithResponse):
16 pass
17
18
19class RedirectLimit(HttpLib2ErrorWithResponse):
20 pass
21
22
23class FailedToDecompressContent(HttpLib2ErrorWithResponse):
24 pass
25
26
27class UnimplementedDigestAuthOptionError(HttpLib2ErrorWithResponse):
28 pass
29
30
31class UnimplementedHmacDigestAuthOptionError(HttpLib2ErrorWithResponse):
32 pass
33
34
35class MalformedHeader(HttpLib2Error):
36 pass
37
38
39class RelativeURIError(HttpLib2Error):
40 pass
41
42
43class ServerNotFoundError(HttpLib2Error):
44 pass
45
46
47class ProxiesUnavailableError(HttpLib2Error):
48 pass