mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 10:29:27 +00:00
Better handle file not found when loading YAML (#23908)
* Better handle file not found * Lint
This commit is contained in:
@@ -312,6 +312,8 @@ async def check_ha_config_file(hass):
|
||||
return result.add_error("File configuration.yaml not found.")
|
||||
config = await hass.async_add_executor_job(
|
||||
load_yaml_config_file, config_path)
|
||||
except FileNotFoundError:
|
||||
return result.add_error("File not found: {}".format(config_path))
|
||||
except HomeAssistantError as err:
|
||||
return result.add_error(
|
||||
"Error loading {}: {}".format(config_path, err))
|
||||
|
||||
Reference in New Issue
Block a user