]> git.0d.be Git - botaradio.git/commitdiff
Handle KeyError for radio title
authorLartza <Lartza@users.noreply.github.com>
Tue, 10 Mar 2020 14:05:33 +0000 (16:05 +0200)
committerLartza <Lartza@users.noreply.github.com>
Tue, 10 Mar 2020 14:05:33 +0000 (16:05 +0200)
media/radio.py

index f2185e582fcda358038f42836402bf99b619041a..e825055601d16b37b7cdf44cbe1b423f5ca970f2 100644 (file)
@@ -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