summaryrefslogtreecommitdiff
path: root/nephilim/mpclient.py
diff options
context:
space:
mode:
Diffstat (limited to 'nephilim/mpclient.py')
-rw-r--r--nephilim/mpclient.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/nephilim/mpclient.py b/nephilim/mpclient.py
index 5c94304..d3e0320 100644
--- a/nephilim/mpclient.py
+++ b/nephilim/mpclient.py
@@ -90,11 +90,11 @@ class MPClient(QtCore.QObject):
try:
self._client.close()
self._client.disconnect()
- except mpd.ConnectionError:
+ except (mpd.ConnectionError, socket.error):
pass
self._client = None
else:
- logging.warning('Attempted to disconnect when not connected.')
+ self._logger.warning('Attempted to disconnect when not connected.')
if self._timer_id:
self.killTimer(self._timer_id)
@@ -111,10 +111,10 @@ class MPClient(QtCore.QObject):
return
try:
self._client.password(password)
- logging.info('Successfully authenticated')
+ self._logger.info('Successfully authenticated')
self._commands = self._retrieve(self._client.commands)
except mpd.CommandError:
- logging.error('Incorrect MPD password.')
+ self._logger.error('Incorrect MPD password.')
def is_connected(self):
"""Returns True if connected to MPD, False otherwise."""
return self._client != None
@@ -306,6 +306,7 @@ class MPClient(QtCore.QObject):
try:
ret = method()
except socket.error:
+ self._logger.error('Connection to MPD broken.')
self._retr_mutex.unlock()
self.disconnect_mpd()
return None