Skip to content
Myr

HTTPError

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent a9822b0 · Browse files · 3 files+7 added−7 removed
This commit

State

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

Diff stats

3 files+7 added−7 removed

  • other:+7 added−7 removed

3 files+7 added−7 removed

modified:requests/__init__.py+1 added-1 removed
27 unmodified lines
28from .sessions import session29from .status_codes import codes30from .exceptions import (31 RequestException, AuthenticationError, Timeout, URLRequired,32 TooManyRedirects32 TooManyRedirects, HTTPError33)
modified:requests/exceptions.py+3 added
10 unmodified lines
11class RequestException(Exception):12 """There was an ambiguous exception that occurred while handling your13 request."""1415class HTTPError(RequestException):16 """An HTTP error occured."""1718class AuthenticationError(RequestException):19 """The authentication credentials provided were invalid."""2021class Timeout(RequestException):
7 unmodified lines
modified:requests/models.py+3 added-6 removed
352 unmodified lines
353 else:354 if self.data:355 body = self._enc_data356 content_type = 'application/x-www-form-urlencoded'357 print body357359360358 # TODO: Setup cookies.359360 # Add content-type if it wasn't explicitly provided.361 if (content_type) and (not 'content-type' in self.headers):
182 unmodified lines
544 if self.error:545 raise self.error546547 if (self.status_code >= 300) and (self.status_code < 400):551 raise RequestException('%s Redirection' % self.status_code)548 raise HTTPError('%s Redirection' % self.status_code)549550 elif (self.status_code >= 400) and (self.status_code < 500):554 raise RequestException('%s Client Error' % self.status_code)551 raise HTTPError('%s Client Error' % self.status_code)552553 elif (self.status_code >= 500) and (self.status_code < 600):557 raise RequestException('%s Server Error' % self.status_code)554 raise HTTPError('%s Server Error' % self.status_code)555556