diff --git a/pytonlib/tonlibjson.py b/pytonlib/tonlibjson.py index 09cd97a..5b6439b 100644 --- a/pytonlib/tonlibjson.py +++ b/pytonlib/tonlibjson.py @@ -205,6 +205,8 @@ async def read_results(self): result = None try: result = await asyncio.wait_for(self.loop.run_in_executor(None, receive_func), timeout=timeout + delta) + except asyncio.CancelledError: + raise except asyncio.TimeoutError: logger.critical(f"Tonlib #{self.ls_index:03d} stuck (timeout error)") self._state = "stuck"