From 765265723ca12310dc36504e379302d01f76f7bf Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 31 Jan 2024 16:17:24 +0100 Subject: [PATCH] Explicitly log when API requests timeout (#4861) Currently a timeout leads to a log entry which simply states: "Error on call http://172.30.32.1:8123/api/core/state: ". From this, it is not immeaditly clear what the problem is. This commit adds a log entry which explicitly states that the request timed out. --- supervisor/homeassistant/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supervisor/homeassistant/api.py b/supervisor/homeassistant/api.py index 566ba0d6d..bbb525187 100644 --- a/supervisor/homeassistant/api.py +++ b/supervisor/homeassistant/api.py @@ -107,7 +107,10 @@ class HomeAssistantAPI(CoreSysAttributes): continue yield resp return - except (TimeoutError, aiohttp.ClientError) as err: + except TimeoutError: + _LOGGER.error("Timeout on call %s.", url) + break + except aiohttp.ClientError as err: _LOGGER.error("Error on call %s: %s", url, err) break