You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a WebPushException e is raised after trying to send a push using pywebpush, the error handling in push_notifications.webpush tries to read e.message, even though it may not exist. This doesn't break anything that isn't already broken, but does produce unnecessary errors.
Traceback (most recent call last):
File ".../venv/lib/python3.5/site-packages/push_notifications/webpush.py", line 30, in webpush_send_message
**kwargs)
File ".../venv/lib/python3.5/site-packages/pywebpush/__init__.py", line 384, in webpush
result, result.text))
pywebpush.WebPushException: Push failed: <Response [400]>: <HTML>
<HEAD>
<TITLE>UnauthorizedRegistration</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>UnauthorizedRegistration</H1>
<H2>Error 400</H2>
</BODY>
</HTML>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".../notifications/models.py", line 75, in send
results = device.send_message(json.dumps(payload))
File ".../venv/lib/python3.5/site-packages/push_notifications/models.py", line 254, in send_message
auth=self.auth, p256dh=self.p256dh, application_id=self.application_id, **kwargs)
File ".../venv/lib/python3.5/site-packages/push_notifications/webpush.py", line 39, in webpush_send_message
raise WebPushError(e.message)
AttributeError: 'WebPushException' object has no attribute 'message'
The text was updated successfully, but these errors were encountered:
rskwan
changed the title
WebPushException not being raised correctly
WebPushError not being raised correctly
Mar 16, 2018
When a WebPushException
e
is raised after trying to send a push using pywebpush, the error handling inpush_notifications.webpush
tries to reade.message
, even though it may not exist. This doesn't break anything that isn't already broken, but does produce unnecessary errors.The text was updated successfully, but these errors were encountered: