Fix handling of KeysUploadError
This commit is contained in:
parent
2211edc25a
commit
d4cf70b273
1 changed files with 2 additions and 3 deletions
|
@ -1,9 +1,8 @@
|
||||||
from nio import RoomMemberEvent, MatrixRoom, KeysUploadError
|
from nio import RoomMemberEvent, MatrixRoom, KeysUploadError
|
||||||
|
|
||||||
async def roommember_callback(room: MatrixRoom, event: RoomMemberEvent, bot):
|
async def roommember_callback(room: MatrixRoom, event: RoomMemberEvent, bot):
|
||||||
try:
|
upload = await bot.matrix_client.keys_upload()
|
||||||
await bot.matrix_client.keys_upload()
|
if isinstance(upload, KeysUploadError):
|
||||||
except KeysUploadError as e:
|
|
||||||
bot.logger.log(f"Failed to upload keys: {e.message}")
|
bot.logger.log(f"Failed to upload keys: {e.message}")
|
||||||
|
|
||||||
if event.membership == "leave":
|
if event.membership == "leave":
|
||||||
|
|
Loading…
Reference in a new issue