load_past_events: raise instead of logging errors

This commit is contained in:
miruka 2019-12-20 09:30:57 -04:00
parent 5e26188dfe
commit d9b7118f45
3 changed files with 8 additions and 6 deletions

View File

@ -48,7 +48,6 @@
## Issues ## Issues
- load_past raise
- invisible uploaded mxc images? - invisible uploaded mxc images?
- first undecryptable message - first undecryptable message
- Join button 502 - Join button 502

View File

@ -558,9 +558,7 @@ class MatrixClient(nio.AsyncClient):
) )
if isinstance(response, nio.RoomMessagesError): if isinstance(response, nio.RoomMessagesError):
log.error("Loading past messages for room %s failed: %s", raise MatrixError.from_nio(response)
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
@ -607,7 +605,10 @@ class MatrixClient(nio.AsyncClient):
more = True more = True
while self.skipped_events[room_id] and not events and more: while self.skipped_events[room_id] and not events and more:
more = await self.load_past_events(room_id) try:
more = await self.load_past_events(room_id)
except MatrixError:
break
async def new_direct_chat(self, invite: str, encrypt: bool = False) -> str: async def new_direct_chat(self, invite: str, encrypt: bool = False) -> str:

View File

@ -133,7 +133,9 @@ Rectangle {
chat.loadingMessages = true chat.loadingMessages = true
py.callClientCoro( py.callClientCoro(
chat.userId, "load_past_events", [chat.roomId], chat.userId,
"load_past_events",
[chat.roomId],
moreToLoad => { moreToLoad => {
try { try {
eventList.canLoad = moreToLoad eventList.canLoad = moreToLoad