File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -350,15 +350,16 @@ import WebPush
350
350
351
351
do {
352
352
try await manager .send (
353
- json: [" title" : " Test Notification" , " body" : " Hello, World!"
353
+ json: [" title" : " Test Notification" , " body" : " Hello, World!" ,
354
+ to: subscriber
354
355
// / If sent from a request, pass the request's logger here to maintain its metadata.
355
356
// logger: request.logger
356
357
)
357
- } catch BadSubscriberError () {
358
+ } catch is BadSubscriberError {
358
359
// / The subscription is no longer valid and should be removed.
359
- } catch MessageTooLargeError () {
360
+ } catch is MessageTooLargeError {
360
361
// / The message was too long and should be shortened.
361
- } catch let error as HTTPError {
362
+ } catch let error as PushServiceError {
362
363
// / The push service ran into trouble. error.response may help here.
363
364
} catch {
364
365
// / An unknown error occurred.
You can’t perform that action at this time.
0 commit comments