Log exceptions in the config flow of Opower (#128146)

log exceptions
This commit is contained in:
tronikos 2024-10-11 03:19:34 -07:00 committed by GitHub
parent 46184188e4
commit c39a1596d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,8 +49,12 @@ async def _validate_login(
try:
await api.async_login()
except InvalidAuth:
_LOGGER.exception(
"Invalid auth when connecting to %s", login_data[CONF_UTILITY]
)
errors["base"] = "invalid_auth"
except CannotConnect:
_LOGGER.exception("Could not connect to %s", login_data[CONF_UTILITY])
errors["base"] = "cannot_connect"
return errors