mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge branch 'develop' into key_val_lists
This commit is contained in:
+5
-3
@@ -841,6 +841,7 @@ class Response(object):
|
||||
if self.error:
|
||||
raise self.error
|
||||
|
||||
http_error_msg = ''
|
||||
if 300 <= self.status_code < 400 and not allow_redirects:
|
||||
http_error_msg = '%s Redirection: %s' % (self.status_code, self.reason)
|
||||
|
||||
@@ -850,6 +851,7 @@ class Response(object):
|
||||
elif 500 <= self.status_code < 600:
|
||||
http_error_msg = '%s Server Error: %s' % (self.status_code, self.reason)
|
||||
|
||||
http_error = HTTPError(http_error_msg)
|
||||
http_error.response = self
|
||||
raise http_error
|
||||
if http_error_msg:
|
||||
http_error = HTTPError(http_error_msg)
|
||||
http_error.response = self
|
||||
raise http_error
|
||||
|
||||
Reference in New Issue
Block a user