mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14: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,
|
||||
FloodWait, FloodPremiumWait,
|
||||
ServiceUnavailable, BadMsgNotification,
|
||||
SecurityCheckMismatch
|
||||
SecurityCheckMismatch, Unauthorized
|
||||
)
|
||||
from pyrogram.raw.all import layer
|
||||
from pyrogram.raw.core import TLObject, MsgContainer, Int, FutureSalts
|
||||
|
|
@ -310,9 +310,9 @@ class Session:
|
|||
error_code = -Int.read(BytesIO(packet))
|
||||
|
||||
if error_code == 404:
|
||||
raise Exception(
|
||||
"Auth key not found in the system. You must delete your session file"
|
||||
"and log in again with your phone number or bot token"
|
||||
raise Unauthorized(
|
||||
"Auth key not found in the system. You must delete your session file "
|
||||
"and log in again with your phone number or bot token."
|
||||
)
|
||||
|
||||
log.warning(
|
||||
|
|
|
|||
Loading…
Reference in a new issue