Skip to content

Commit

Permalink
Handle deconnection in idle mode (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
eonpatapon committed Jan 2, 2013
1 parent d042b90 commit 2bc1238
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mpDris2.in
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,11 @@ class MPDWrapper(mpd.MPDClient):
# Events

def timer_callback(self):
was_idle = self.idle_leave()
try:
was_idle = self.idle_leave()
except (socket.error, mpd.MPDError, socket.timeout):
self.reconnect()
return False
self._update_properties()
if was_idle:
self.idle_enter()
Expand Down

0 comments on commit 2bc1238

Please sign in to comment.