Use new format for logging exception - homeassistent/api.py (#3182)

This commit is contained in:
Finn 2021-10-01 14:18:23 +02:00 committed by GitHub
parent d33beb06cd
commit 0433d72ae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,8 +49,9 @@ class HomeAssistantAPI(CoreSysAttributes):
ssl=False,
) as resp:
if resp.status != 200:
_LOGGER.error("Can't update Home Assistant access token!")
raise HomeAssistantAuthError()
raise HomeAssistantAuthError(
"Can't update Home Assistant access token!", _LOGGER.error
)
_LOGGER.info("Updated Home Assistant API token")
tokens = await resp.json()