Skip to content

Commit 90182af

Browse files
Updated example in readme to match current state of the code
Fixes #59 Co-Authored-By: Christoph Hagen <[email protected]>
1 parent 295f994 commit 90182af

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,15 +350,16 @@ import WebPush
350350

351351
do {
352352
try await manager.send(
353-
json: ["title": "Test Notification", "body": "Hello, World!"
353+
json: ["title": "Test Notification", "body": "Hello, World!",
354+
to: subscriber
354355
/// If sent from a request, pass the request's logger here to maintain its metadata.
355356
// logger: request.logger
356357
)
357-
} catch BadSubscriberError() {
358+
} catch is BadSubscriberError {
358359
/// The subscription is no longer valid and should be removed.
359-
} catch MessageTooLargeError() {
360+
} catch is MessageTooLargeError {
360361
/// The message was too long and should be shortened.
361-
} catch let error as HTTPError {
362+
} catch let error as PushServiceError {
362363
/// The push service ran into trouble. error.response may help here.
363364
} catch {
364365
/// An unknown error occurred.

0 commit comments

Comments
 (0)