mirror of
https://github.com/beetbox/beets.git
synced 2026-02-11 01:47:46 +01:00
mpdupdate: Improve error message
When beets can't connect to mpd, display the underlying error instead of dying with an ugly exception.
This commit is contained in:
parent
93190ac089
commit
85ffe444dc
1 changed files with 7 additions and 1 deletions
|
|
@ -97,7 +97,13 @@ class MPDUpdatePlugin(BeetsPlugin):
|
|||
"""
|
||||
self._log.info('Updating MPD database...')
|
||||
|
||||
s = BufferedSocket(host, port)
|
||||
try:
|
||||
s = BufferedSocket(host, port)
|
||||
except socket.error as e:
|
||||
self._log.warning(u'MPD connection failed: {0}',
|
||||
unicode(e.strerror))
|
||||
return
|
||||
|
||||
resp = s.readline()
|
||||
if 'OK MPD' not in resp:
|
||||
self._log.warning(u'MPD connection failed: {0!r}', resp)
|
||||
|
|
|
|||
Loading…
Reference in a new issue