]> kaliko git repositories - python-musicpd.git/commitdiff
Better socket timeout documentation (closes #14)
authorKaliko Jack <kaliko@azylum.org>
Fri, 29 Oct 2021 14:52:42 +0000 (16:52 +0200)
committerKaliko Jack <kaliko@azylum.org>
Fri, 29 Oct 2021 14:52:42 +0000 (16:52 +0200)
doc/source/use.rst

index cdf0ed223effa1dcf53066685a7c5dc33b05a68c..a071084fb1650c8095634d9ecafb3bf23196ca19 100644 (file)
@@ -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