From 9148a096c9939a89ecca79578e5fc2590f2dfd6f Mon Sep 17 00:00:00 2001 From: Kaliko Jack Date: Fri, 29 Oct 2021 16:52:42 +0200 Subject: [PATCH] Better socket timeout documentation (closes #14) --- doc/source/use.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/source/use.rst b/doc/source/use.rst index cdf0ed2..a071084 100644 --- a/doc/source/use.rst +++ b/doc/source/use.rst @@ -218,6 +218,10 @@ Here is a solution to use ``idle`` command with ``socket_timeout``: cli.noidle() except socket.timeout as err: print(f'{err} (timeout {cli.socket_timeout})') + except (OSError, musicpd.MPDError) as err: + print(f'{err!r}') + if cli._sock is not None: + cli.disconnect() except KeyboardInterrupt: pass @@ -237,3 +241,4 @@ couple of seconds for these commands should never occur). .. _MPD protocol documentation: http://www.musicpd.org/doc/protocol/ +.. vim: spell spelllang=en -- 2.39.5