From 58aa3fdda7b6985dc07ab7d6dfe212d4dbc86d9e Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 17 Feb 2024 09:58:32 -0700 Subject: [PATCH] only print the full dictionary on unexpected results --- webpush.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webpush.py b/webpush.py index d9bb949..63a2925 100644 --- a/webpush.py +++ b/webpush.py @@ -82,7 +82,8 @@ try: vapid_claims={"sub": "mailto:info@timesafari.app"} ) print(f"Response: {response}") - print(f"Full response: {response.__dict__}") + if response.status_code != 201: + print(f"Full response: {response.__dict__}") # log the .reason from Apple # https://developer.apple.com/documentation/usernotifications/sending_web_push_notifications_in_web_apps_and_browsers#3994594 except WebPushException as ex: