mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-04 21:50:57 +03:00
Fix using the wrong logger in Connection
This commit is contained in:
parent
740a715acd
commit
f2e77f4030
|
@ -158,7 +158,7 @@ class Connection(abc.ABC):
|
||||||
pass
|
pass
|
||||||
except Exception:
|
except Exception:
|
||||||
msg = 'Unexpected exception in the send loop'
|
msg = 'Unexpected exception in the send loop'
|
||||||
logging.exception(msg)
|
__log__.exception(msg)
|
||||||
self._disconnect(ConnectionError(msg))
|
self._disconnect(ConnectionError(msg))
|
||||||
|
|
||||||
async def _recv_loop(self):
|
async def _recv_loop(self):
|
||||||
|
@ -174,13 +174,13 @@ class Connection(abc.ABC):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if isinstance(e, asyncio.IncompleteReadError):
|
if isinstance(e, asyncio.IncompleteReadError):
|
||||||
msg = 'The server closed the connection'
|
msg = 'The server closed the connection'
|
||||||
logging.info(msg)
|
__log__.info(msg)
|
||||||
elif isinstance(e, InvalidChecksumError):
|
elif isinstance(e, InvalidChecksumError):
|
||||||
msg = 'The server response had an invalid checksum'
|
msg = 'The server response had an invalid checksum'
|
||||||
logging.info(msg)
|
__log__.info(msg)
|
||||||
else:
|
else:
|
||||||
msg = 'Unexpected exception in the receive loop'
|
msg = 'Unexpected exception in the receive loop'
|
||||||
logging.exception(msg)
|
__log__.exception(msg)
|
||||||
|
|
||||||
await self._recv_queue.put(None)
|
await self._recv_queue.put(None)
|
||||||
self._disconnect(ConnectionError(msg))
|
self._disconnect(ConnectionError(msg))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user