fix(client): add FloodWait exception to media download

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
KNF Apps 2023-10-02 11:34:27 -06:00 committed by wulan17
parent a7859ba790
commit 4b8fceecdc
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -840,6 +840,9 @@ class Client(Methods):
if isinstance(e, asyncio.CancelledError): if isinstance(e, asyncio.CancelledError):
raise e raise e
if isinstance(e, pyrogram.errors.FloodWait):
raise e
return None return None
else: else:
if in_memory: if in_memory:
@ -1062,6 +1065,8 @@ class Client(Methods):
await cdn_session.stop() await cdn_session.stop()
except pyrogram.StopTransmission: except pyrogram.StopTransmission:
raise raise
except pyrogram.errors.FloodWait:
raise
except Exception as e: except Exception as e:
log.exception(e) log.exception(e)
finally: finally: