From d4cf70b273d5a77496b8a082b7296ab8cd4ed1f3 Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 7 Dec 2023 16:38:47 +0100 Subject: [PATCH] Fix handling of KeysUploadError --- src/gptbot/callbacks/roommember.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gptbot/callbacks/roommember.py b/src/gptbot/callbacks/roommember.py index 8702516..57cdd74 100644 --- a/src/gptbot/callbacks/roommember.py +++ b/src/gptbot/callbacks/roommember.py @@ -1,9 +1,8 @@ from nio import RoomMemberEvent, MatrixRoom, KeysUploadError async def roommember_callback(room: MatrixRoom, event: RoomMemberEvent, bot): - try: - await bot.matrix_client.keys_upload() - except KeysUploadError as e: + upload = await bot.matrix_client.keys_upload() + if isinstance(upload, KeysUploadError): bot.logger.log(f"Failed to upload keys: {e.message}") if event.membership == "leave":