Clean up redudant exceptions from handlers (#51741)
This commit is contained in:
parent
b4aeddd12f
commit
f17a5f0db9
13 changed files with 16 additions and 20 deletions
|
@ -112,7 +112,7 @@ class PioneerDevice(MediaPlayerEntity):
|
|||
try:
|
||||
try:
|
||||
telnet = telnetlib.Telnet(self._host, self._port, self._timeout)
|
||||
except (ConnectionRefusedError, OSError):
|
||||
except OSError:
|
||||
_LOGGER.warning("Pioneer %s refused connection", self._name)
|
||||
return
|
||||
telnet.write(command.encode("ASCII") + b"\r")
|
||||
|
@ -125,7 +125,7 @@ class PioneerDevice(MediaPlayerEntity):
|
|||
"""Get the latest details from the device."""
|
||||
try:
|
||||
telnet = telnetlib.Telnet(self._host, self._port, self._timeout)
|
||||
except (ConnectionRefusedError, OSError):
|
||||
except OSError:
|
||||
_LOGGER.warning("Pioneer %s refused connection", self._name)
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue