Skip to content

Commit

Permalink
protocols/logging,pc_rpc: do not print errors on Windows when clients…
Browse files Browse the repository at this point in the history
… disconnect
sbourdeauducq committed Jan 27, 2016
1 parent 7aaeb63 commit 27c12a5
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions artiq/protocols/logging.py
Original file line number Diff line number Diff line change
@@ -125,6 +125,9 @@ async def _handle_connection_cr(self, reader, writer):
return
source, remainder = linesplit
parser.line_input(remainder)
except (ConnectionResetError, ConnectionAbortedError, BrokenPipeError):
# May happens on Windows when client disconnects
pass
finally:
writer.close()

3 changes: 3 additions & 0 deletions artiq/protocols/pc_rpc.py
Original file line number Diff line number Diff line change
@@ -502,6 +502,9 @@ async def _handle_connection_cr(self, reader, writer):
"message": traceback.format_exc()}
line = pyon.encode(obj) + "\n"
writer.write(line.encode())
except (ConnectionResetError, ConnectionAbortedError, BrokenPipeError):
# May happens on Windows when client disconnects
pass
finally:
writer.close()

0 comments on commit 27c12a5

Please sign in to comment.