Except msg_id KeyError on bad salt/msg

This commit is contained in:
Lonami Exo 2018-06-18 17:20:31 +02:00
parent 3648f7c756
commit 09ea1179ca

View File

@ -545,7 +545,13 @@ class MTProtoSender:
bad_salt = message.obj
__log__.debug('Handling bad salt for message %d', bad_salt.bad_msg_id)
self.state.salt = bad_salt.new_server_salt
self._send_queue.put_nowait(self._pending_messages[bad_salt.bad_msg_id])
try:
self._send_queue.put_nowait(
self._pending_messages[bad_salt.bad_msg_id])
except KeyError:
# May be MsgsAck, those are not saved in pending messages
__log__.info('Message %d not resent due to bad salt',
bad_salt.bad_msg_id)
async def _handle_bad_notification(self, message):
"""
@ -575,7 +581,13 @@ class MTProtoSender:
return
# Messages are to be re-sent once we've corrected the issue
self._send_queue.put_nowait(self._pending_messages[bad_msg.bad_msg_id])
try:
self._send_queue.put_nowait(
self._pending_messages[bad_msg.bad_msg_id])
except KeyError:
# May be MsgsAck, those are not saved in pending messages
__log__.info('Message %d not resent due to bad msg',
bad_msg.bad_msg_id)
async def _handle_detailed_info(self, message):
"""