Merge branch 'develop' into asyncio

# Conflicts:
#	pyrogram/session/session.py
This commit is contained in:
Dan 2018-06-28 00:41:11 +02:00
commit 4f4531cf18
2 changed files with 6 additions and 1 deletions

View 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.
1 id message
2 AUTH_KEY_DUPLICATED Authorization error. You must log out and log in again with your phone number. We apologize for the inconvenience.

View File

@ -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: