Skip to content

Commit

Permalink
Merge pull request #21 from krombel/fix_pointer_issue
Browse files Browse the repository at this point in the history
Fix GCM push response access to enable logging again
  • Loading branch information
dbkr authored Sep 7, 2017
2 parents 4abac38 + 99babf7 commit c7992fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sygnal/gcmpushkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,18 @@ def dispatchNotification(self, n):
elif req.response.status_code == 400:
logger.error(
"%d from server, we have sent something invalid! Error: %r",
response.status_code,
response.json(),
req.response.status_code,
req.response.text,
)
# permanent failure: give up
return failed
raise Exception("Invalid request")
elif req.response.status_code == 401:
logger.error(
"401 from server! Our API key is invalid? Error: %r",
response.json(),
req.response.text,
)
# permanent failure: give up
return failed
raise Exception("Not authorized to push")
elif req.response.status_code / 100 == 2:
resp_object = req.response.json()
if 'results' not in resp_object:
Expand Down

0 comments on commit c7992fd

Please sign in to comment.