Handle stacktrace when rtorrent host is unreachable (#24541)

This commit is contained in:
Matt Black authored and Paulus Schoutsen committed 2019-06-15 12:48:55 -07:00
1 parent 616301f7ee
commit 6b3c740dc3
1 file changed
+3 -2
+3 -2
View File
@@ -99,8 +99,9 @@ class RTorrentSensor(Entity):
try:
self.data = multicall()
self._available = True
except (xmlrpc.client.ProtocolError, ConnectionRefusedError):
_LOGGER.error("Connection to rtorrent lost")
except (xmlrpc.client.ProtocolError,
ConnectionRefusedError, OSError) as ex:
_LOGGER.error("Connection to rtorrent failed (%s)", ex)
self._available = False
return