Commit 85285970 authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed logging in server.

parent b75d3586
......@@ -64,10 +64,12 @@ class SimpleRpcServer(ConnectionManager):
try:
connection.receive()
except socket.error as err:
logging.error('Socket error while receiving from client '
'fd/%s: %s' % (fd, err))
connection.shutdown(self._on_disconnect)
del self._clients[fd]
except Exception as err:
logging.error('Unknown error while receiving from client'
logging.error('Unknown error while receiving from client '
'fd/%s: %s' % (fd, err))
connection.shutdown(self._on_disconnect)
del self._clients[fd]
......@@ -77,15 +79,18 @@ class SimpleRpcServer(ConnectionManager):
try:
connection.send()
except socket.error as err:
logging.error('Socket error while sending to the client '
'fd/%s: %s' % (fd, err))
connection.shutdown(self._on_disconnect)
del self._clients[fd]
except Exception as err:
logging.error('Unknown error while sending to the client'
logging.error('Unknown error while sending to the client '
'fd/%s: %s' % (fd, err))
connection.shutdown(self._on_disconnect)
del self._clients[fd]
if event & select.EPOLLHUP:
logging.error('Socket HUP fd/%s: %s' % (fd, err))
connection.shutdown(self._on_disconnect)
del self._clients[fd]
......
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