Skip to content

Commit

Permalink
Capture connection errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Booth committed Mar 6, 2021
1 parent ac6ccbf commit 65b67d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aiorpcx/rawsocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from aiorpcx.util import NetAddress


class ConnectionLostError(Exception):
class ConnectionLostError(ConnectionError):
pass


Expand Down
2 changes: 2 additions & 0 deletions aiorpcx/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ async def _process_messages(self, recv_message):

try:
requests = self.connection.receive_message(message)
except ConnectionError:
return
except ProtocolError as e:
self.logger.debug(str(e))
if e.code == JSONRPC.PARSE_ERROR:
Expand Down

0 comments on commit 65b67d2

Please sign in to comment.