Skip to content

Commit

Permalink
githubutils: use the json_res for the exception info
Browse files Browse the repository at this point in the history
  • Loading branch information
mathstuf committed Oct 27, 2015
1 parent 5bee1c4 commit 2f3645b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bugwarrior/services/githubutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ def _getter(url, auth, subkey=None):
while 'next' in link:
response = requests.get(link['next'], **kwargs)

# And.. if we didn't get good results, just bail.
if response.status_code != 200:
raise IOError(
"Non-200 status code %r; %r; %r" % (
response.status_code, url, response.json))

if callable(response.json):
# Newer python-requests
json_res = response.json()
else:
# Older python-requests
json_res = response.json

# And.. if we didn't get good results, just bail.
if response.status_code != 200:
raise IOError(
"Non-200 status code %r; %r; %r" % (
response.status_code, url, json_res))

if subkey is not None:
json_res = json_res[subkey]

Expand Down

0 comments on commit 2f3645b

Please sign in to comment.