From 6b3c740dc368d3c53e8038a9e28427858cf3c7d2 Mon Sep 17 00:00:00 2001 From: Matt Black Date: Sun, 16 Jun 2019 05:48:55 +1000 Subject: [PATCH] Handle stacktrace when rtorrent host is unreachable (#24541) --- homeassistant/components/rtorrent/sensor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/rtorrent/sensor.py b/homeassistant/components/rtorrent/sensor.py index 8ec6a45b639..d7912e0d6be 100644 --- a/homeassistant/components/rtorrent/sensor.py +++ b/homeassistant/components/rtorrent/sensor.py @@ -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