add PhoneNumberBanned exception to 'def authorize'

This commit is contained in:
RussFP 2018-02-01 12:49:43 +03:00
parent e2a7e33f3d
commit df5666e2a0

View File

@ -37,7 +37,7 @@ from pyrogram.api.errors import (
PhoneNumberUnoccupied, PhoneCodeInvalid, PhoneCodeHashEmpty,
PhoneCodeExpired, PhoneCodeEmpty, SessionPasswordNeeded,
PasswordHashInvalid, FloodWait, PeerIdInvalid, FilePartMissing,
ChatAdminRequired, FirstnameInvalid
ChatAdminRequired, FirstnameInvalid, PhoneNumberBanned
)
from pyrogram.api.types import (
User, Chat, Channel,
@ -283,6 +283,9 @@ class Client:
except FloodWait as e:
print(e.MESSAGE.format(x=e.x))
time.sleep(e.x)
except PhoneNumberBanned as e:
log.error(e, exc_info=True)
raise
except Exception as e:
log.error(e, exc_info=True)
else: