From: Kaliko Jack Date: Fri, 29 Oct 2021 14:52:42 +0000 (+0200) Subject: Better socket timeout documentation (closes #14) X-Git-Tag: v0.8.0~10 X-Git-Url: http://git.kaliko.me/?p=python-musicpd.git;a=commitdiff_plain;h=9148a096c9939a89ecca79578e5fc2590f2dfd6f;hp=40455e48fef4d5ac8bf2c19f745d7495180e7205 Better socket timeout documentation (closes #14) --- 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