push_notifications: Fix logging.exception misuse.

logging.exception should only be called from an exception handler.
https://docs.python.org/3/library/logging.html#logging.exception

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2023-08-30 12:15:59 -07:00
committed by Anders Kaseorg
parent e1ea737ee2
commit 792a44b382

View File

@@ -282,7 +282,7 @@ def send_apple_push_notification(
device.token, device.token,
) )
elif isinstance(result, BaseException): elif isinstance(result, BaseException):
logger.exception( logger.error(
"APNs: Error sending for user %s to device %s", "APNs: Error sending for user %s to device %s",
user_identity, user_identity,
device.token, device.token,