How to use the pyfcm.errors.InternalPackageError function in pyfcm

To help you get started, we’ve selected a few pyfcm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github olucurious / PyFCM / pyfcm / extensions / tornado.py View on Github external
request = HTTPRequest(
                url=self.FCM_END_POINT,
                method='POST',
                headers=self.request_headers(),
                body=payload
            )

            response = yield self.http_client.fetch(request)

            if response.code == 200:
                yield self.parse_response(response)
                return
            elif response.code == 401:
                raise AuthenticationError('There was an error authenticating the sender account')
            elif response.code == 400:
                raise InternalPackageError('Unknown internal error')
            else:
                raise FCMServerError('FCM server is temporarily unavailable')