aboutsummaryrefslogtreecommitdiff
path: root/urllib3/exceptions.py
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2015-12-22 14:15:26 +0000
committerChristopher Baines <mail@cbaines.net>2015-12-22 14:15:26 +0000
commit6b4e166f2475c4be0df7d82dc4d86aa43c6cb066 (patch)
treeeb8f0fa0ed67f14cc5c5645f6bb12494e7966e98 /urllib3/exceptions.py
parentb6983c7c258a0ce3365f7c7409f2a06a8ed70bca (diff)
parent24ae6ba32069ca15f4a163e386964a3accdccf63 (diff)
downloadpython-urllib3-6b4e166f2475c4be0df7d82dc4d86aa43c6cb066.tar
python-urllib3-6b4e166f2475c4be0df7d82dc4d86aa43c6cb066.tar.gz
merge patched into master
Diffstat (limited to 'urllib3/exceptions.py')
-rw-r--r--urllib3/exceptions.py14
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