X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fsimafm.py;fp=sima%2Flib%2Fsimafm.py;h=bdfd02d0c3f50e5c866d727066521977d0b7650d;hb=774e755d4a4fb985548cd3d17703c1f700687ff3;hp=bd203f74f3330f1da06a0d7abd5d1f0c741e8a0b;hpb=f1ed2e8232b4ecabbfe65aa6ab2d28567989e104;p=mpd-sima.git diff --git a/sima/lib/simafm.py b/sima/lib/simafm.py index bd203f7..bdfd02d 100644 --- a/sima/lib/simafm.py +++ b/sima/lib/simafm.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2009-2014 kaliko +# Copyright (c) 2009-2014, 2021 kaliko # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -101,9 +101,9 @@ class SimaFM: ans = self.http(self.root_url, payload) try: ans.json() - except ValueError: + except ValueError as err: # Corrupted/malformed cache? cf. gitlab issue #35 - raise WSError('Malformed json, try purging the cache: %s') + raise WSError('Malformed json, try purging the cache: %s') from err self._controls_answer(ans.json()) # pylint: disable=no-member # Artist might be found but return no 'artist' list… # cf. "Mulatu Astatqe" vs. "Mulatu Astatqé" with autocorrect=0