diff options
Diffstat (limited to 'nephilim/mpd.py')
-rw-r--r-- | nephilim/mpd.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nephilim/mpd.py b/nephilim/mpd.py index 97aa54f..bcdf3ac 100644 --- a/nephilim/mpd.py +++ b/nephilim/mpd.py @@ -144,7 +144,13 @@ class MPDClient(QtCore.QObject): def _docommand(self, command, args, retval): if self._commandlist is not None and not callable(retval): raise CommandListError("%s not allowed in command list" % command) - self._writecommand(command, args) + try: + self._writecommand(command, args) + except socket.error, e: + self.logger.error('Error sending command: %s.'%e) + self.disconnect_mpd() + return None + if self._commandlist is None: if callable(retval): return retval() |