mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-23 01:46:35 +03:00
Except ConnectionAbortedError on TcpClient
This commit is contained in:
parent
23ab70fc29
commit
992017ddf8
|
@ -113,7 +113,7 @@ class TcpClient:
|
|||
self._socket.sendall(data)
|
||||
except socket.timeout as e:
|
||||
raise TimeoutError() from e
|
||||
except BrokenPipeError:
|
||||
except (BrokenPipeError, ConnectionAbortedError):
|
||||
self._raise_connection_reset()
|
||||
except OSError as e:
|
||||
if e.errno == errno.EBADF:
|
||||
|
@ -139,6 +139,11 @@ class TcpClient:
|
|||
partial = self._socket.recv(bytes_left)
|
||||
except socket.timeout as e:
|
||||
raise TimeoutError() from e
|
||||
except ConnectionAbortedError:
|
||||
# ConnectionAbortedError: [WinError 10053]
|
||||
# An established connection was aborted by
|
||||
# the software in your host machine.
|
||||
self._raise_connection_reset()
|
||||
except OSError as e:
|
||||
if e.errno == errno.EBADF or e.errno == errno.ENOTSOCK:
|
||||
self._raise_connection_reset()
|
||||
|
|
Loading…
Reference in New Issue
Block a user