Wallbox Add translation to exception config entry auth failed (#148649)

This commit is contained in:
Hessel 2025-07-12 20:40:39 +02:00 committed by GitHub
parent cf2ef4cec1
commit 72dc2b15d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -94,7 +94,9 @@ def _require_authentication[_WallboxCoordinatorT: WallboxCoordinator, **_P](
return func(self, *args, **kwargs)
except requests.exceptions.HTTPError as wallbox_connection_error:
if wallbox_connection_error.response.status_code == HTTPStatus.FORBIDDEN:
raise ConfigEntryAuthFailed from wallbox_connection_error
raise ConfigEntryAuthFailed(
translation_domain=DOMAIN, translation_key="invalid_auth"
) from wallbox_connection_error
raise HomeAssistantError(
translation_domain=DOMAIN, translation_key="api_failed"
) from wallbox_connection_error