aboutsummaryrefslogtreecommitdiff
path: root/urllib3/exceptions.py
diff options
context:
space:
mode:
authorSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:19:41 -0700
committerSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:19:41 -0700
commitb6ab7bae87b22c6fae783e8850533219d3bf8a29 (patch)
tree472a760e2e976ea3e9545e09584392accee9cd6d /urllib3/exceptions.py
parent54bdd56778a37ea9d56d451d4ae49b99cbbfceaa (diff)
downloadpython-urllib3-b6ab7bae87b22c6fae783e8850533219d3bf8a29.tar
python-urllib3-b6ab7bae87b22c6fae783e8850533219d3bf8a29.tar.gz
Imported Upstream version 1.10
Diffstat (limited to 'urllib3/exceptions.py')
-rw-r--r--urllib3/exceptions.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/urllib3/exceptions.py b/urllib3/exceptions.py
index 7519ba9..0c6fd3c 100644
--- a/urllib3/exceptions.py
+++ b/urllib3/exceptions.py
@@ -72,11 +72,8 @@ class MaxRetryError(RequestError):
def __init__(self, pool, url, reason=None):
self.reason = reason
- message = "Max retries exceeded with url: %s" % url
- if reason:
- message += " (Caused by %r)" % reason
- else:
- message += " (Caused by redirect)"
+ message = "Max retries exceeded with url: %s (Caused by %r)" % (
+ url, reason)
RequestError.__init__(self, pool, url, message)
@@ -141,6 +138,12 @@ class LocationParseError(LocationValueError):
self.location = location
+class ResponseError(HTTPError):
+ "Used as a container for an error reason supplied in a MaxRetryError."
+ GENERIC_ERROR = 'too many error responses'
+ SPECIFIC_ERROR = 'too many {status_code} error responses'
+
+
class SecurityWarning(HTTPWarning):
"Warned when perfoming security reducing actions"
pass