mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-31 14:25:55 +00:00
Handle AUTH_KEY_DUPLICATED error
This commit is contained in:
@@ -31,7 +31,7 @@ from pyrogram import __copyright__, __license__, __version__
|
||||
from pyrogram.api import functions, types, core
|
||||
from pyrogram.api.all import layer
|
||||
from pyrogram.api.core import Message, Object, MsgContainer, Long, FutureSalt, Int
|
||||
from pyrogram.api.errors import Error, InternalServerError
|
||||
from pyrogram.api.errors import Error, InternalServerError, AuthKeyDuplicated
|
||||
from pyrogram.connection import Connection
|
||||
from pyrogram.crypto import AES, KDF
|
||||
from .internals import MsgId, MsgFactory, DataCenter
|
||||
@@ -157,6 +157,9 @@ class Session:
|
||||
self.ping_thread.start()
|
||||
|
||||
log.info("Connection inited: Layer {}".format(layer))
|
||||
except AuthKeyDuplicated as e:
|
||||
self.stop()
|
||||
raise e
|
||||
except (OSError, TimeoutError, Error):
|
||||
self.stop()
|
||||
except Exception as e:
|
||||
|
Reference in New Issue
Block a user