diff options
author | Daniele Tricoli <eriol@mornie.org> | 2015-10-14 19:04:18 +0200 |
---|---|---|
committer | Daniele Tricoli <eriol@mornie.org> | 2015-10-14 19:04:18 +0200 |
commit | cb40ec082506c0d9eb05978839bed2f12541af35 (patch) | |
tree | 0fe8938e38767200c05ba3e8071bfe6777f75a3e /requests/packages/urllib3/exceptions.py | |
parent | b4a5af4fcbf4e5d0f741aaf9978c728235b11a56 (diff) | |
download | python-requests-cb40ec082506c0d9eb05978839bed2f12541af35.tar python-requests-cb40ec082506c0d9eb05978839bed2f12541af35.tar.gz |
Import requests_2.8.1.orig.tar.gz
Diffstat (limited to 'requests/packages/urllib3/exceptions.py')
-rw-r--r-- | requests/packages/urllib3/exceptions.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/requests/packages/urllib3/exceptions.py b/requests/packages/urllib3/exceptions.py index 31bda1c..9607d65 100644 --- a/requests/packages/urllib3/exceptions.py +++ b/requests/packages/urllib3/exceptions.py @@ -112,6 +112,9 @@ class ConnectTimeoutError(TimeoutError): "Raised when a socket timeout occurs while connecting to a server" pass +class NewConnectionError(ConnectTimeoutError, PoolError): + "Raised when we fail to establish a new connection. Usually ECONNREFUSED." + pass class EmptyPoolError(PoolError): "Raised when a pool runs out of connections and no more are allowed." @@ -149,6 +152,11 @@ class SecurityWarning(HTTPWarning): pass +class SubjectAltNameWarning(SecurityWarning): + "Warned when connecting to a host with a certificate missing a SAN." + pass + + class InsecureRequestWarning(SecurityWarning): "Warned when making an unverified HTTPS request." pass @@ -167,3 +175,19 @@ class InsecurePlatformWarning(SecurityWarning): class ResponseNotChunked(ProtocolError, ValueError): "Response needs to be chunked in order to read it as chunks." pass + + +class ProxySchemeUnknown(AssertionError, ValueError): + "ProxyManager does not support the supplied scheme" + # TODO(t-8ch): Stop inheriting from AssertionError in v2.0. + + def __init__(self, scheme): + message = "Not supported proxy scheme %s" % scheme + super(ProxySchemeUnknown, self).__init__(message) + + +class HeaderParsingError(HTTPError): + "Raised by assert_header_parsing, but we convert it to a log.warning statement." + def __init__(self, defects, unparsed_data): + message = '%s, unparsed data: %r' % (defects or 'Unknown', unparsed_data) + super(HeaderParsingError, self).__init__(message) |