bluelet: catch ECONNRESET
When ncmpcpp quits after an error it causes a "connection reset by peer"
exception, also known as ECONNRESET (104) in errno terms. In Python
2 this is mapped to a `socket.error` and in Python 3 this is
`ConnectionResetError` which is thankfully a subclass of the
`socket.error` exception class.
@@ -346,6 +346,10 @@ def run(root_coro):
exc.args[0] == errno.EPIPE:
# Broken pipe. Remote host disconnected.
pass
+ elif isinstance(exc.args, tuple) and \
+ exc.args[0] == errno.ECONNRESET:
+ # Connection was reset by peer.
+ pass
else:
traceback.print_exc()
# Abort the coroutine.
