mirror of
https://github.com/home-assistant/core.git
synced 2025-07-07 21:37:07 +00:00
Fix setup failure due to temporary DNS issue in Minecraft Server (#112068)
Change ConfigEntryError to ConfigEntryNotReady on failed init
This commit is contained in:
parent
0ff2106589
commit
9e428c6c5f
@ -14,7 +14,7 @@ from homeassistant.const import (
|
||||
Platform,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.exceptions import ConfigEntryError
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
import homeassistant.helpers.device_registry as dr
|
||||
import homeassistant.helpers.entity_registry as er
|
||||
|
||||
@ -41,9 +41,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
try:
|
||||
await api.async_initialize()
|
||||
except MinecraftServerAddressError as error:
|
||||
raise ConfigEntryError(
|
||||
f"Server address in configuration entry is invalid: {error}"
|
||||
) from error
|
||||
raise ConfigEntryNotReady(f"Initialization failed: {error}") from error
|
||||
|
||||
# Create coordinator instance.
|
||||
coordinator = MinecraftServerCoordinator(hass, entry.data[CONF_NAME], api)
|
||||
|
@ -153,7 +153,7 @@ async def test_setup_entry_lookup_failure(
|
||||
)
|
||||
|
||||
await hass.async_block_till_done()
|
||||
assert java_mock_config_entry.state == ConfigEntryState.SETUP_ERROR
|
||||
assert java_mock_config_entry.state == ConfigEntryState.SETUP_RETRY
|
||||
|
||||
|
||||
async def test_setup_entry_init_failure(
|
||||
|
Loading…
x
Reference in New Issue
Block a user