mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-31 20:54:51 +00:00
Merge branch 'develop' into asyncio
# Conflicts: # pyrogram/session/session.py
This commit is contained in:
commit
4f4531cf18
2 changed files with 6 additions and 1 deletions
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 a new issue