Fix handling of KeysUploadError

This commit is contained in:
Kumi 2023-12-07 16:38:47 +01:00
parent 2211edc25a
commit d4cf70b273
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -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":