mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 04:35:24 +00:00
Change Exception to Unauthorized when auth key not found
This commit is contained in:
parent
fd1fbbecc7
commit
31d6a28bbd
@ -30,7 +30,7 @@ from pyrogram.connection import Connection
|
|||||||
from pyrogram.crypto import mtproto
|
from pyrogram.crypto import mtproto
|
||||||
from pyrogram.errors import (
|
from pyrogram.errors import (
|
||||||
RPCError, InternalServerError, AuthKeyDuplicated, FloodWait, FloodPremiumWait, ServiceUnavailable, BadMsgNotification,
|
RPCError, InternalServerError, AuthKeyDuplicated, FloodWait, FloodPremiumWait, 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
|
||||||
@ -307,9 +307,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 New Issue
Block a user