Rely on core config entry error logging in Plex setup (#73368)

Rely on core config entry error logging
This commit is contained in:
jjlawren 2022-06-11 13:39:43 -05:00 committed by GitHub
parent b4e9a9b1ed
commit cb1011156d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@ from plexwebsocket import (
import requests.exceptions import requests.exceptions
from homeassistant.components.media_player import DOMAIN as MP_DOMAIN, BrowseError from homeassistant.components.media_player import DOMAIN as MP_DOMAIN, BrowseError
from homeassistant.config_entries import ConfigEntry, ConfigEntryState from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_URL, CONF_VERIFY_SSL, EVENT_HOMEASSISTANT_STOP from homeassistant.const import CONF_URL, CONF_VERIFY_SSL, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
@ -139,12 +139,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry, data={**entry.data, PLEX_SERVER_CONFIG: new_server_data} entry, data={**entry.data, PLEX_SERVER_CONFIG: new_server_data}
) )
except requests.exceptions.ConnectionError as error: except requests.exceptions.ConnectionError as error:
if entry.state is not ConfigEntryState.SETUP_RETRY:
_LOGGER.error(
"Plex server (%s) could not be reached: [%s]",
server_config[CONF_URL],
error,
)
raise ConfigEntryNotReady from error raise ConfigEntryNotReady from error
except plexapi.exceptions.Unauthorized as ex: except plexapi.exceptions.Unauthorized as ex:
raise ConfigEntryAuthFailed( raise ConfigEntryAuthFailed(