From: Kaliko Jack <kaliko@azylum.org>
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: https://git.kaliko.me/?a=commitdiff_plain;h=9148a096c9939a89ecca79578e5fc2590f2dfd6f;p=python-musicpd.git

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