Commits

Matt Good committed 5dfc34e

get_device_info: return None if device token not found instead of raising an error

Comments (0)

Files changed (1)

     def get_device_info(self, device_token):
         url = DEVICE_TOKEN_URL + device_token
         status, response = self._request('GET', '', url)
-        if status != 200:
+        if status == 404:
+            return None
+        elif status != 200:
             raise AirshipFailure(status, response)
         return json.loads(response)