mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-18 13:34:54 +00:00
Merge branch 'develop' into asyncio
# Conflicts: # pyrogram/session/session.py
This commit is contained in:
commit
4f4531cf18
2
compiler/error/source/406_NOT_ACCEPTABLE.tsv
Normal file
2
compiler/error/source/406_NOT_ACCEPTABLE.tsv
Normal file
@ -0,0 +1,2 @@
|
||||
id message
|
||||
AUTH_KEY_DUPLICATED Authorization error. You must log out and log in again with your phone number. We apologize for the inconvenience.
|
|
@ -27,7 +27,7 @@ from pyrogram import __copyright__, __license__, __version__
|
||||
from pyrogram.api import functions, types
|
||||
from pyrogram.api.all import layer
|
||||
from pyrogram.api.core import Object, MsgContainer, Int, Long, FutureSalt, FutureSalts
|
||||
from pyrogram.api.errors import Error, InternalServerError
|
||||
from pyrogram.api.errors import Error, InternalServerError, AuthKeyDuplicated
|
||||
from pyrogram.connection import Connection
|
||||
from pyrogram.crypto import MTProto
|
||||
from .internals import MsgId, MsgFactory, DataCenter
|
||||
@ -143,6 +143,9 @@ class Session:
|
||||
self.ping_task = asyncio.ensure_future(self.ping())
|
||||
|
||||
log.info("Connection inited: Layer {}".format(layer))
|
||||
except AuthKeyDuplicated as e:
|
||||
self.stop()
|
||||
raise e
|
||||
except (OSError, TimeoutError, Error):
|
||||
await self.stop()
|
||||
except Exception as e:
|
||||
|
Loading…
Reference in New Issue
Block a user