Browse Source

Send TIMEOUT checkpoint on asyncio.TimeoutErrors

Tulir Asokan 2 years ago
parent
commit
97586e26d4
1 changed files with 2 additions and 0 deletions
  1. 2 0
      mautrix_instagram/portal.py

+ 2 - 0
mautrix_instagram/portal.py

@@ -330,6 +330,8 @@ class Portal(DBPortal, BasePortal):
     def _status_from_exception(e: Exception) -> MessageSendCheckpointStatus:
         if isinstance(e, NotImplementedError):
             return MessageSendCheckpointStatus.UNSUPPORTED
+        elif isinstance(e, asyncio.TimeoutError):
+            return MessageSendCheckpointStatus.TIMEOUT
         return MessageSendCheckpointStatus.PERM_FAILURE
 
     async def handle_matrix_message(