Catch errors in automation (instead of raise unexpected error) in Overkiz (#135026)

Catch errors in automation (instead of raise unexpected error)
This commit is contained in:
Mick Vleeshouwer 2025-01-07 20:24:39 +01:00 committed by GitHub
parent 48da88583f
commit 802ad55493
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,7 @@ from typing import Any, cast
from urllib.parse import urlparse from urllib.parse import urlparse
from pyoverkiz.enums import OverkizCommand, Protocol from pyoverkiz.enums import OverkizCommand, Protocol
from pyoverkiz.exceptions import OverkizException from pyoverkiz.exceptions import BaseOverkizException
from pyoverkiz.models import Command, Device, StateDefinition from pyoverkiz.models import Command, Device, StateDefinition
from pyoverkiz.types import StateType as OverkizStateType from pyoverkiz.types import StateType as OverkizStateType
@ -105,7 +105,7 @@ class OverkizExecutor:
"Home Assistant", "Home Assistant",
) )
# Catch Overkiz exceptions to support `continue_on_error` functionality # Catch Overkiz exceptions to support `continue_on_error` functionality
except OverkizException as exception: except BaseOverkizException as exception:
raise HomeAssistantError(exception) from exception raise HomeAssistantError(exception) from exception
# ExecutionRegisteredEvent doesn't contain the device_url, thus we need to register it here # ExecutionRegisteredEvent doesn't contain the device_url, thus we need to register it here