From 218f10a62d2f30607ae5eae16cea737a037b58e1 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 9 Mar 2013 11:33:55 -0800 Subject: [PATCH] echonest_tempo: catch socket.error --- beetsplug/echonest_tempo.py | 3 ++- docs/changelog.rst | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/beetsplug/echonest_tempo.py b/beetsplug/echonest_tempo.py index 8e0b119bb..d3a55d213 100644 --- a/beetsplug/echonest_tempo.py +++ b/beetsplug/echonest_tempo.py @@ -22,6 +22,7 @@ from beets import ui from beets import config import pyechonest.config import pyechonest.song +import socket # Global logger. log = logging.getLogger('beets') @@ -79,7 +80,7 @@ def get_tempo(artist, title): else: log.warn(u'echonest_tempo: {0}'.format(e.args[0][0])) return None - except pyechonest.util.EchoNestIOError as e: + except (pyechonest.util.EchoNestIOError, socket.error) as e: log.debug(u'echonest_tempo: IO error: {0}'.format(e)) time.sleep(RETRY_INTERVAL) else: diff --git a/docs/changelog.rst b/docs/changelog.rst index 797c930da..1cc67dd8f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -47,6 +47,8 @@ Other stuff: are missing all metadata. * :doc:`/plugins/mbcollection`: Show friendly, human-readable errors when MusicBrainz exceptions occur. +* :doc:`/plugins/echonest_tempo`: Catch socket errors that are not handled by + the Echo Nest library. 1.1b2 (February 16, 2013) -------------------------