Skip to content
Myr

Include response.content in raised HTTPErrors

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kristian Glass · committed by Kristian Glass · parent 876e174 · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:requests/models.py+3 added-3 removed
819 unmodified lines
820 if self.error:821 raise self.error822823 if (self.status_code >= 300) and (self.status_code < 400) and not allow_redirects:824 http_error = HTTPError('%s Redirection' % self.status_code)824 http_error = HTTPError('%s Redirection: %s' % (self.status_code, self.content))825 http_error.response = self826 raise http_error827828 elif (self.status_code >= 400) and (self.status_code < 500):829 http_error = HTTPError('%s Client Error' % self.status_code)829 http_error = HTTPError('%s Client Error: %s' % (self.status_code, self.content))830 http_error.response = self831 raise http_error832833 elif (self.status_code >= 500) and (self.status_code < 600):834 http_error = HTTPError('%s Server Error' % self.status_code)834 http_error = HTTPError('%s Server Error: %s' % (self.status_code, self.content))835 http_error.response = self836 raise http_error