MPDCoverGrid: Try-Except-Bl?cke hinzugef?gt

This commit is contained in:
Olli 2012-04-14 13:33:28 +02:00
parent 65460ea0cb
commit 6d4e3c4b78

View file

@ -17,11 +17,23 @@ class MPDCoverGrid:
def connect(self):
self.client.connect(self._host, self._port)
if self._password:
self.client.password(self._password)
try:
self.client.connect(self._host, self._port)
if self._password:
self.client.password(self._password)
except CommandError as e:
# TODO Error
print(e)
except IOError as e:
# TODO Error
print(e)
def disconnect(self):
self.client.disconnect()
try:
self.client.disconnect()
except IOError as e:
# TODO Error
print(e)
self.client = MPDClient()