X-Git-Url: http://git.kaliko.me/?p=python-musicpd.git;a=blobdiff_plain;f=doc%2Fsource%2Fuse.rst;fp=doc%2Fsource%2Fuse.rst;h=a071084fb1650c8095634d9ecafb3bf23196ca19;hp=cdf0ed223effa1dcf53066685a7c5dc33b05a68c;hb=9148a096c9939a89ecca79578e5fc2590f2dfd6f;hpb=40455e48fef4d5ac8bf2c19f745d7495180e7205 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