Skip to content

Commit

Permalink
Merge pull request #2648 from msabramo/display_url_for_exceptions
Browse files Browse the repository at this point in the history
Display URL as part of HTTP error messages
  • Loading branch information
sigmavirus24 committed Jun 22, 2015
2 parents 9bbab33 + e3bdec5 commit f5dacf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions requests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,10 @@ def raise_for_status(self):
http_error_msg = ''

if 400 <= self.status_code < 500:
http_error_msg = '%s Client Error: %s' % (self.status_code, self.reason)
http_error_msg = '%s Client Error: %s for url: %s' % (self.status_code, self.reason, self.url)

elif 500 <= self.status_code < 600:
http_error_msg = '%s Server Error: %s' % (self.status_code, self.reason)
http_error_msg = '%s Server Error: %s for url: %s' % (self.status_code, self.reason, self.url)

if http_error_msg:
raise HTTPError(http_error_msg, response=self)
Expand Down

0 comments on commit f5dacf8

Please sign in to comment.