diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 686531e3..cf92bcf3 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -29,7 +29,7 @@ from pyrogram import __copyright__, __license__, __version__ from pyrogram import raw from pyrogram.connection import Connection from pyrogram.crypto import mtproto -from pyrogram.errors import RPCError, InternalServerError, AuthKeyDuplicated, FloodWait +from pyrogram.errors import RPCError, InternalServerError, AuthKeyDuplicated, FloodWait, ServiceUnavailable from pyrogram.raw.all import layer from pyrogram.raw.core import TLObject, MsgContainer, Int, FutureSalt, FutureSalts from .internals import MsgId, MsgFactory @@ -432,7 +432,7 @@ class Session: log.warning(f'[{self.client.session_name}] Sleeping for {amount}s (required by "{query}")') await asyncio.sleep(amount) - except (OSError, TimeoutError, InternalServerError) as e: + except (OSError, TimeoutError, InternalServerError, ServiceUnavailable) as e: if retries == 0: raise e from None