Skip to content

Commit

Permalink
Merge pull request #263 from jsousa1919/master
Browse files Browse the repository at this point in the history
Fixed HTTPError usage
  • Loading branch information
burnash committed Aug 11, 2015
2 parents a8f40f4 + 2789ff5 commit c47b4b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions gspread/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ class RequestError(GSpreadException):

class HTTPError(RequestError):
"""DEPRECATED. Error while sending API request."""
def __init__(self, code, msg):
super(HTTPError, self).__init__(msg)
self.code = code
2 changes: 1 addition & 1 deletion gspread/httpsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def request(self, method, url, data=None, headers=None):
response = self.connections[uri.scheme + uri.netloc].getresponse()

if response.status > 399:
raise HTTPError("%s: %s" % (response.status, response.read()))
raise HTTPError(response.status, "%s: %s" % (response.status, response.read()))
return response

def get(self, url, **kwargs):
Expand Down

0 comments on commit c47b4b2

Please sign in to comment.