Skip to content

Commit

Permalink
Merge pull request #246 from mathstuf/better-json-info-in-errors
Browse files Browse the repository at this point in the history
Better json info in errors
  • Loading branch information
ralphbean committed Oct 27, 2015
2 parents 18771ad + 2f3645b commit a99e335
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 a99e335

Please sign in to comment.