Skip to content

Commit f4dc75b

Browse files
committed
Merge pull request #27 from pagles/master
Handles unexpected error codes.
2 parents a75c19d + eabb8b0 commit f4dc75b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

gcm/gcm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ def make_request(self, data, is_json=True):
144144
raise GCMAuthenticationException("There was an error authenticating the sender account")
145145
elif e.code == 503:
146146
raise GCMUnavailableException("GCM service is unavailable")
147+
else:
148+
error = "GCM service error: %d" % e.code
149+
raise GCMUnavailableException(error)
147150
except urllib2.URLError as e:
148151
raise GCMConnectionException("There was an internal error in the GCM server while trying to process the request")
149152

0 commit comments

Comments
 (0)