From 9e4745873647f07db68546b659de3dd6db73a8f8 Mon Sep 17 00:00:00 2001 From: Dimitri Bouniol Date: Sat, 8 Feb 2025 06:23:49 -0800 Subject: [PATCH] Updated example in readme to match current state of the code Fixes #59 Co-Authored-By: Christoph Hagen --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c35d90f..6bd9d73 100644 --- a/README.md +++ b/README.md @@ -350,15 +350,16 @@ import WebPush do { try await manager.send( - json: ["title": "Test Notification", "body": "Hello, World!" + json: ["title": "Test Notification", "body": "Hello, World!", + to: subscriber /// If sent from a request, pass the request's logger here to maintain its metadata. // logger: request.logger ) -} catch BadSubscriberError() { +} catch is BadSubscriberError { /// The subscription is no longer valid and should be removed. -} catch MessageTooLargeError() { +} catch is MessageTooLargeError { /// The message was too long and should be shortened. -} catch let error as HTTPError { +} catch let error as PushServiceError { /// The push service ran into trouble. error.response may help here. } catch { /// An unknown error occurred.