Skip to content

Commit

Permalink
Explicitly log when API requests timeout (#4861)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
agners authored Jan 31, 2024
1 parent 7e20502 commit 7652657
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion supervisor/homeassistant/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ async def make_request(
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

Expand Down

0 comments on commit 7652657

Please sign in to comment.