X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;ds=sidebyside;f=sima%2Fmpdclient.py;h=6bbe63dd7b97816a4ccd52cbdcef3efa795c3d99;hb=3b4178f;hp=c4ebadeaa7e1d4453aa92d8bbda5830c0715842e;hpb=d893e62ef71fcac5c8449e97b0503ad33bb0904a;p=mpd-sima.git diff --git a/sima/mpdclient.py b/sima/mpdclient.py index c4ebade..6bbe63d 100644 --- a/sima/mpdclient.py +++ b/sima/mpdclient.py @@ -23,7 +23,7 @@ from logging import getLogger from select import select # external module -from musicpd import MPDClient, MPDError +from musicpd import MPDClient, MPDError as PlayerError # local import @@ -31,11 +31,6 @@ from .lib.meta import Meta, Artist, Album from .lib.track import Track from .lib.simastr import SimaStr from .utils.leven import levenshtein_ratio -from .utils.utils import MPDSimaException - - -class PlayerError(MPDSimaException): - """Fatal error in the player.""" # Some decorators @@ -130,8 +125,6 @@ class MPD(MPDClient): return super().__getattr__(cmd) except OSError as err: # socket errors raise PlayerError(err) from err - except MPDError as err: # hight level MPD client errors - raise PlayerError(err) from err def disconnect(self): """Overriding explicitly MPDClient.disconnect()""" @@ -161,7 +154,7 @@ class MPD(MPDClient): if password: try: self.password(password) - except (MPDError, OSError) as err: + except OSError as err: raise PlayerError(f"Could not connect to '{host}': {err}") from err # Controls we have sufficient rights available_cmd = self.commands() @@ -253,8 +246,6 @@ class MPD(MPDClient): self.noidle() except OSError as err: raise PlayerError(err) from err - except MPDError as err: # hight level MPD client errors - raise PlayerError(err) from err def clean(self): """Clean blocking event (idle) and pending commands