mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 04:35:24 +00:00
Add FloodWait except to media download (#19)
Add FloodWait except to media download to handle this error from the script. Before this change the exception would only be printed and the script would continue without a way to detect this error. Co-authored-by: KNF Apps <jordyamc@users.noreply.github.com>
This commit is contained in:
parent
d0b71cf2a9
commit
da4b467e8f
@ -802,6 +802,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:
|
||||||
@ -1033,6 +1036,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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user