Commit 8885d865 authored by olivier R-D's avatar olivier R-D

stronger socket error catching

parent c6284d10
......@@ -3,6 +3,7 @@ import os
from concurrent.futures import Future
import functools
import threading
from socket import error as SocketError
try:
# we prefer to use bundles asyncio version, otherwise fallback to trollius
......@@ -100,8 +101,8 @@ class SocketWrapper(object):
while size > 0:
try:
chunk = self.socket.recv(size)
except (OSError, ConnectionResetError):
raise SocketClosedException("Server socket has closed")
except (OSError, SocketError) as ex:
raise SocketClosedException("Server socket has closed", ex)
if not chunk:
raise SocketClosedException("Server socket has closed")
data += chunk
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment