load_past_events: Catch RoomMessagesError

This commit is contained in:
miruka 2019-09-09 08:26:09 -04:00
parent 3ef32b4c04
commit 6b26aa6d0b

View File

@ -222,7 +222,7 @@ class MatrixClient(nio.AsyncClient):
) )
if isinstance(response, nio.RoomSendError): if isinstance(response, nio.RoomSendError):
log.error("Failed to send message: %s", response) log.error("Sending message failed: %s", response)
async def load_past_events(self, room_id: str) -> bool: async def load_past_events(self, room_id: str) -> bool:
@ -239,6 +239,11 @@ class MatrixClient(nio.AsyncClient):
limit = 100 if room_id in self.loaded_once_rooms else 25, limit = 100 if room_id in self.loaded_once_rooms else 25,
) )
if isinstance(response, nio.RoomMessagesError):
log.error("Loading past messages for room %s failed: %s",
room_id, response)
return True
self.loaded_once_rooms.add(room_id) self.loaded_once_rooms.add(room_id)
more_to_load = True more_to_load = True