echonest_tempo: catch socket.error

This commit is contained in:
Adrian Sampson 2013-03-09 11:33:55 -08:00
parent 69f2659410
commit 218f10a62d
2 changed files with 4 additions and 1 deletions

View file

@ -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:

View file

@ -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)
-------------------------