Skip to content

Commit

Permalink
raise for requests status
Browse files Browse the repository at this point in the history
  • Loading branch information
p1c2u committed Aug 31, 2016
1 parent 75a400f commit 1260a96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wykop/api/requesters/requests.py
Expand Up @@ -25,8 +25,9 @@ def make_request(self, url, data=None, headers=None, files=None):
try:
files = self._get_files(files)
method = self._get_method(data, files)
req = request(method, url, data=data, headers=headers, files=files)
return force_text(req.content)
resp = request(method, url, data=data, headers=headers, files=files)
resp.raise_for_status()
return force_text(resp.content)
except RequestException as e:
raise WykopAPIError(0, str(e))

Expand Down

0 comments on commit 1260a96

Please sign in to comment.