mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 13:29:47 +00:00
Handle the right errors
This commit is contained in:
@@ -4,6 +4,8 @@ import logging
|
||||
import socket
|
||||
import ssl as ssl_mod
|
||||
|
||||
from ...errors import InvalidChecksumError
|
||||
|
||||
__log__ = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -173,6 +175,9 @@ class Connection(abc.ABC):
|
||||
if isinstance(e, asyncio.IncompleteReadError):
|
||||
msg = 'The server closed the connection'
|
||||
logging.info(msg)
|
||||
elif isinstance(e, InvalidChecksumError):
|
||||
msg = 'The server response had an invalid checksum'
|
||||
logging.info(msg)
|
||||
else:
|
||||
msg = 'Unexpected exception in the receive loop'
|
||||
logging.exception(msg)
|
||||
|
Reference in New Issue
Block a user