mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Humanize core config errors in check_config helper (#103635)
This commit is contained in:
parent
40dc6d8191
commit
cc5eda76d3
@ -151,7 +151,9 @@ async def async_check_ha_config_file( # noqa: C901
|
|||||||
core_config = CORE_CONFIG_SCHEMA(core_config)
|
core_config = CORE_CONFIG_SCHEMA(core_config)
|
||||||
result[CONF_CORE] = core_config
|
result[CONF_CORE] = core_config
|
||||||
except vol.Invalid as err:
|
except vol.Invalid as err:
|
||||||
result.add_error(err, CONF_CORE, core_config)
|
result.add_error(
|
||||||
|
_format_config_error(err, CONF_CORE, core_config)[0], CONF_CORE, core_config
|
||||||
|
)
|
||||||
core_config = {}
|
core_config = {}
|
||||||
|
|
||||||
# Merge packages
|
# Merge packages
|
||||||
|
@ -73,7 +73,11 @@ async def test_bad_core_config(hass: HomeAssistant) -> None:
|
|||||||
log_ha_config(res)
|
log_ha_config(res)
|
||||||
|
|
||||||
error = CheckConfigError(
|
error = CheckConfigError(
|
||||||
"not a valid value for dictionary value @ data['unit_system']",
|
(
|
||||||
|
"Invalid config for [homeassistant]: not a valid value for dictionary "
|
||||||
|
"value @ data['unit_system']. Got 'bad'. (See "
|
||||||
|
f"{hass.config.path(YAML_CONFIG_FILE)}, line 2). "
|
||||||
|
),
|
||||||
"homeassistant",
|
"homeassistant",
|
||||||
{"unit_system": "bad"},
|
{"unit_system": "bad"},
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user