mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 23:04:51 +00:00
Change Exception to Unauthorized when auth key not found
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
58f0031ead
commit
f37c5c9f2f
1 changed files with 4 additions and 4 deletions
|
|
@ -33,7 +33,7 @@ from pyrogram.errors import (
|
||||||
RPCError, InternalServerError, AuthKeyDuplicated,
|
RPCError, InternalServerError, AuthKeyDuplicated,
|
||||||
FloodWait, FloodPremiumWait,
|
FloodWait, FloodPremiumWait,
|
||||||
ServiceUnavailable, BadMsgNotification,
|
ServiceUnavailable, BadMsgNotification,
|
||||||
SecurityCheckMismatch
|
SecurityCheckMismatch, Unauthorized
|
||||||
)
|
)
|
||||||
from pyrogram.raw.all import layer
|
from pyrogram.raw.all import layer
|
||||||
from pyrogram.raw.core import TLObject, MsgContainer, Int, FutureSalts
|
from pyrogram.raw.core import TLObject, MsgContainer, Int, FutureSalts
|
||||||
|
|
@ -310,9 +310,9 @@ class Session:
|
||||||
error_code = -Int.read(BytesIO(packet))
|
error_code = -Int.read(BytesIO(packet))
|
||||||
|
|
||||||
if error_code == 404:
|
if error_code == 404:
|
||||||
raise Exception(
|
raise Unauthorized(
|
||||||
"Auth key not found in the system. You must delete your session file"
|
"Auth key not found in the system. You must delete your session file "
|
||||||
"and log in again with your phone number or bot token"
|
"and log in again with your phone number or bot token."
|
||||||
)
|
)
|
||||||
|
|
||||||
log.warning(
|
log.warning(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue