diff options
author | Christopher Baines <mail@cbaines.net> | 2015-12-22 14:09:50 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2015-12-22 14:09:50 +0000 |
commit | dff63335f212d32d7c1a4bb5276f2d31f5995ea1 (patch) | |
tree | 4b32f426e18fec38cbfa9468d0dfc0cbf2279363 /urllib3/exceptions.py | |
parent | 2b3d330a120a16e97cecd5163b5d454dcfe38a2b (diff) | |
download | python-urllib3-dff63335f212d32d7c1a4bb5276f2d31f5995ea1.tar python-urllib3-dff63335f212d32d7c1a4bb5276f2d31f5995ea1.tar.gz |
Import python-urllib3_1.13.1.orig.tar.gzupstream/1.13.1upstream
Diffstat (limited to 'urllib3/exceptions.py')
-rw-r--r-- | urllib3/exceptions.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/urllib3/exceptions.py b/urllib3/exceptions.py index 9607d65..8e07eb6 100644 --- a/urllib3/exceptions.py +++ b/urllib3/exceptions.py @@ -1,16 +1,17 @@ +from __future__ import absolute_import +# Base Exceptions -## Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass + class HTTPWarning(Warning): "Base warning used by this module." pass - class PoolError(HTTPError): "Base exception for errors caused within a pool." def __init__(self, pool, message): @@ -57,7 +58,7 @@ class ProtocolError(HTTPError): ConnectionError = ProtocolError -## Leaf Exceptions +# Leaf Exceptions class MaxRetryError(RequestError): """Raised when the maximum number of retries is exceeded. @@ -112,10 +113,12 @@ 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." pass @@ -172,6 +175,11 @@ class InsecurePlatformWarning(SecurityWarning): pass +class SNIMissingWarning(HTTPWarning): + "Warned when making a HTTPS request without SNI available." + pass + + class ResponseNotChunked(ProtocolError, ValueError): "Response needs to be chunked in order to read it as chunks." pass |