olucurious / PyFCM

Python client for FCM - Firebase Cloud Messaging (Android, iOS and Web)
http://olucurious.github.io/PyFCM/
MIT License
802 stars 204 forks source link

raise AuthenticationError when status_code == 401 #332

Closed Niccari closed 2 months ago

Niccari commented 2 months ago

The following TypeError occurred when a 401 error occurred. Fixed to use AuthenticationError.

Traceback (most recent call last):
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/pyfcm/fcm.py", line 67, in notify
    return self.parse_response(response)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/pyfcm/baseapi.py", line 195, in parse_response
    raise ("There was an error authenticating the sender account")
TypeError: exceptions must derive from BaseException