codekingpro/portable-devtools
114k
1# All exceptions raised here derive from HttpLib2Error2class HttpLib2Error(Exception):3 pass4 5 6# Some exceptions can be caught and optionally7# be turned back into responses.8class HttpLib2ErrorWithResponse(HttpLib2Error):9 def __init__(self, desc, response, content):10 self.response = response11 self.content = content12 HttpLib2Error.__init__(self, desc)13 14 15class RedirectMissingLocation(HttpLib2ErrorWithResponse):16 pass17 18 19class RedirectLimit(HttpLib2ErrorWithResponse):20 pass21 22 23class FailedToDecompressContent(HttpLib2ErrorWithResponse):24 pass25 26 27class UnimplementedDigestAuthOptionError(HttpLib2ErrorWithResponse):28 pass29 30 31class UnimplementedHmacDigestAuthOptionError(HttpLib2ErrorWithResponse):32 pass33 34 35class MalformedHeader(HttpLib2Error):36 pass37 38 39class RelativeURIError(HttpLib2Error):40 pass41 42 43class ServerNotFoundError(HttpLib2Error):44 pass45 46 47class ProxiesUnavailableError(HttpLib2Error):48 pass49 