diff --git a/pyrogram/client.py b/pyrogram/client.py index e800969d..43cff1d5 100644 --- a/pyrogram/client.py +++ b/pyrogram/client.py @@ -45,7 +45,8 @@ from pyrogram.errors import CDNFileHashMismatch from pyrogram.errors import ( SessionPasswordNeeded, VolumeLocNotFound, ChannelPrivate, - BadRequest, ChannelInvalid, PersistentTimestampInvalid, PersistentTimestampOutdated + BadRequest, ChannelInvalid, PersistentTimestampInvalid, PersistentTimestampOutdated, + FloodWait, FloodPremiumWait ) from pyrogram.handlers.handler import Handler from pyrogram.methods import Methods @@ -1151,7 +1152,7 @@ class Client(Methods): if isinstance(e, asyncio.CancelledError): raise e - if isinstance(e, pyrogram.errors.FloodWait): + if isinstance(e, (FloodWait, FloodPremiumWait)): raise e return None @@ -1376,7 +1377,7 @@ class Client(Methods): await cdn_session.stop() except pyrogram.StopTransmission: raise - except pyrogram.errors.FloodWait: + except (FloodWait, FloodPremiumWait): raise except Exception as e: log.exception(e)