The knx integration catches exceptions in action handlers but only logs them instead of re-raising. This means the user gets no feedback in the UI when an action fails, and automations continue executing as if the action succeeded.
Affected methods in services.py:
service_event_register_modify (services.py)
How to fix:
Replace the except blocks that only log with ones that raise HomeAssistantError:
# Before (bad)
except SomeError as err:
_LOGGER.error("Failed: %s", err)
# After (good)
except SomeError as err:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="failed_to_turn_on",
) from err
Add the corresponding translation keys to strings.json. After fixing, remove the # pylint: disable-next=home-assistant-action-swallowed-exception comments.
Part of home-assistant/epics#64
The
knxintegration catches exceptions in action handlers but only logs them instead of re-raising. This means the user gets no feedback in the UI when an action fails, and automations continue executing as if the action succeeded.Affected methods in
services.py:service_event_register_modify(services.py)How to fix:
Replace the
exceptblocks that only log with ones that raiseHomeAssistantError:Add the corresponding translation keys to
strings.json. After fixing, remove the# pylint: disable-next=home-assistant-action-swallowed-exceptioncomments.Part of home-assistant/epics#64