mirror of
https://github.com/beetbox/beets.git
synced 2026-02-22 23:33:50 +01:00
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.
This commit is contained in:
parent
81b1faa053
commit
80286ea898
1 changed files with 4 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue