Преглед изворни кода

Send TIMEOUT checkpoint on asyncio.TimeoutErrors

Tulir Asokan пре 2 година
родитељ
комит
97586e26d4
1 измењених фајлова са 2 додато и 0 уклоњено
  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(