MPDCoverGrid: Try-Except-Bl?cke hinzugef?gt
This commit is contained in:
parent
65460ea0cb
commit
6d4e3c4b78
1 changed files with 16 additions and 4 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue