From 31cd41780977d5246559a7dead3eea77520f9deb Mon Sep 17 00:00:00 2001 From: Kaliko Jack Date: Wed, 7 Feb 2024 18:26:19 +0100 Subject: [PATCH] Document Exceptions --- doc/source/use.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/source/use.rst b/doc/source/use.rst index 7029684..e8d6d53 100644 --- a/doc/source/use.rst +++ b/doc/source/use.rst @@ -218,7 +218,7 @@ Fetching album covers is possible with albumart, here is an example: >>> print('something went wrong', file=sys.stderr) >>> cli.disconnect() -A `CommandError` is raised if the album does not expose a cover. +A :py:obj:`musicpd.CommandError` is raised if the album does not expose a cover. You can also use `readpicture` command to fetch embedded picture: @@ -314,6 +314,15 @@ could also be that MPD took too much time to answer, but MPD taking more than a couple of seconds for these commands should never occur). +Exceptions +---------- + +The :py:obj:`musicpd.MPDClient.connect` method raises +:py:obj:`musicpd.ConnectionError` only but then, calling other MPD commands, +the module can raise :py:obj:`musicpd.MPDError` or an :py:obj:`OSError` depending on the error and where it occurs. + +Using musicpd module both :py:obj:`musicpd.MPDError` and :py:obj:`OSError` exceptions families are expected. + .. _MPD protocol documentation: http://www.musicpd.org/doc/protocol/ .. _snake case: https://en.wikipedia.org/wiki/Snake_case .. vim: spell spelllang=en -- 2.39.2