zaru / webpush

webpush, Encryption Utilities for Web Push protocol
MIT License
394 stars 73 forks source link

No error handling? #104

Open WagnerMoreira opened 2 years ago

WagnerMoreira commented 2 years ago

How do we handle errors when payload_send() fails?

Tashows commented 2 years ago

I was just looking for this as well.

collimarco commented 2 years ago

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 commented 2 years ago

Thanks @collimarco !