Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error handling? #104

Open
Tracked by #1
WagnerMoreira opened this issue Mar 8, 2022 · 3 comments
Open
Tracked by #1

No error handling? #104

WagnerMoreira opened this issue Mar 8, 2022 · 3 comments

Comments

@WagnerMoreira
Copy link

How do we handle errors when payload_send() fails?

@Tashows
Copy link

Tashows commented Mar 15, 2022

I was just looking for this as well.

@collimarco
Copy link
Contributor

You need to catch and manage properly all the various exceptions raised by this gem:
https://github.com/zaru/webpush/blob/master/lib/webpush/errors.rb

And here you can find a list of the most common web push errors that you should handle:
https://blog.pushpad.xyz/2022/04/web-push-errors-explained-with-http-status-codes/

@WagnerMoreira
Copy link
Author

Thanks @collimarco !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants