mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
fix: properly handle FloodPremiumWait
implementation yoinked from 0d2bd64871
now exports the FloodPremiumWait class when compiling the errors
This commit is contained in:
parent
3a632d4590
commit
f22b68b3fb
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
|
@ -1121,7 +1122,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
|
||||
|
|
@ -1346,7 +1347,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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue