webpush icon indicating copy to clipboard operation
webpush copied to clipboard

No error handling?

Open WagnerMoreira opened this issue 3 years ago • 3 comments

How do we handle errors when payload_send() fails?

WagnerMoreira avatar Mar 08 '22 15:03 WagnerMoreira

I was just looking for this as well.

Tashows avatar Mar 15 '22 10:03 Tashows

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/

collimarco avatar May 20 '22 14:05 collimarco

Thanks @collimarco !

WagnerMoreira avatar May 25 '22 15:05 WagnerMoreira