webpush icon indicating copy to clipboard operation
webpush copied to clipboard

Throw `WebPushStatusException` as a checked exception

Open stefanrother opened this issue 1 year ago • 0 comments

Problem

WebPush.getSubscriptionState() throws a WebPushStatusException which causes problems when calling this library from Java:

  • Java tools don't neccessarily recognize that a WebPushStatusException is thrown (it's more or less invisible to Java)
  • in a unit test it's hard to mock an exception that Java doesn't believe to be thrown

Suggestion

Add @Throws(WebPushStatusException::class) to WebPush.getSubscriptionState()

stefanrother avatar Sep 12 '24 16:09 stefanrother