Avoid leaking exception trace for philips_js (#97491)

Avoid leaking exception trace
pull/97609/head
Joakim Plate 2023-07-31 14:21:34 +02:00 committed by Franck Nijhof
parent c950abd323
commit 278f02c86f
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
1 changed files with 9 additions and 2 deletions

View File

@ -7,7 +7,12 @@ from datetime import timedelta
import logging
from typing import Any
from haphilipsjs import AutenticationFailure, ConnectionFailure, PhilipsTV
from haphilipsjs import (
AutenticationFailure,
ConnectionFailure,
GeneralFailure,
PhilipsTV,
)
from haphilipsjs.typing import SystemType
from homeassistant.config_entries import ConfigEntry
@ -22,7 +27,7 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryAuthFailed
from homeassistant.helpers.debounce import Debouncer
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import CONF_ALLOW_NOTIFY, CONF_SYSTEM, DOMAIN
@ -187,3 +192,5 @@ class PhilipsTVDataUpdateCoordinator(DataUpdateCoordinator[None]):
pass
except AutenticationFailure as exception:
raise ConfigEntryAuthFailed(str(exception)) from exception
except GeneralFailure as exception:
raise UpdateFailed(str(exception)) from exception