Add LimitExceededError nio callback
This commit is contained in:
@@ -143,7 +143,10 @@ class MatrixClient(nio.AsyncClient):
|
||||
)
|
||||
|
||||
async with self.send_locks[room_id]:
|
||||
print(await self.room_send(room_id, "m.room.message", content))
|
||||
response = await self.room_send(room_id, "m.room.message", content)
|
||||
|
||||
if isinstance(response, nio.RoomSendError):
|
||||
log.error("Failed to send message: %s", response)
|
||||
|
||||
|
||||
# Callbacks for nio responses
|
||||
@@ -194,6 +197,11 @@ class MatrixClient(nio.AsyncClient):
|
||||
)
|
||||
|
||||
|
||||
async def onLimitExceededError(self, resp: nio.LimitExceededError) -> None:
|
||||
# TODO: show something in the client
|
||||
log.warning("Failed to send message: %s", resp)
|
||||
|
||||
|
||||
# Callbacks for nio events
|
||||
|
||||
# Special %tokens for event contents:
|
||||
|
Reference in New Issue
Block a user