mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +00:00
Handle AUTH_KEY_DUPLICATED error
This commit is contained in:
parent
38b7abec35
commit
6e4c608875
@ -31,7 +31,7 @@ from pyrogram import __copyright__, __license__, __version__
|
|||||||
from pyrogram.api import functions, types, core
|
from pyrogram.api import functions, types, core
|
||||||
from pyrogram.api.all import layer
|
from pyrogram.api.all import layer
|
||||||
from pyrogram.api.core import Message, Object, MsgContainer, Long, FutureSalt, Int
|
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.connection import Connection
|
||||||
from pyrogram.crypto import AES, KDF
|
from pyrogram.crypto import AES, KDF
|
||||||
from .internals import MsgId, MsgFactory, DataCenter
|
from .internals import MsgId, MsgFactory, DataCenter
|
||||||
@ -157,6 +157,9 @@ class Session:
|
|||||||
self.ping_thread.start()
|
self.ping_thread.start()
|
||||||
|
|
||||||
log.info("Connection inited: Layer {}".format(layer))
|
log.info("Connection inited: Layer {}".format(layer))
|
||||||
|
except AuthKeyDuplicated as e:
|
||||||
|
self.stop()
|
||||||
|
raise e
|
||||||
except (OSError, TimeoutError, Error):
|
except (OSError, TimeoutError, Error):
|
||||||
self.stop()
|
self.stop()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user