Compare commits

...

2 commits

Author SHA1 Message Date
EDM115
c5161f8d12
Merge f22b68b3fb into 6f616ebed8 2025-06-11 08:04:55 -07:00
EDM115
f22b68b3fb
fix: properly handle FloodPremiumWait
implementation yoinked from 0d2bd64871
now exports the FloodPremiumWait class when compiling the errors
2025-04-11 00:18:45 +02:00

View file

@ -46,7 +46,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
@ -1129,7 +1130,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
@ -1354,7 +1355,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)