From bb126401e262442de1a900945e8ad351227283a4 Mon Sep 17 00:00:00 2001 From: Lartza Date: Tue, 10 Mar 2020 16:05:33 +0200 Subject: [PATCH] Handle KeyError for radio title --- media/radio.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/media/radio.py b/media/radio.py index f2185e5..e825055 100644 --- a/media/radio.py +++ b/media/radio.py @@ -80,10 +80,9 @@ def get_radio_title(url): except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError, requests.exceptions.ReadTimeout, - requests.exceptions.Timeout) as e: - error_traceback = traceback.format_exc() - error = error_traceback.rstrip().split("\n")[-1] - log.debug("radio: unsuccessful attempts on fetching radio title (icy): " + error) + requests.exceptions.Timeout, + KeyError) as e: + log.debug("radio: unsuccessful attempts on fetching radio title (icy)") return url