Better handle file not found when loading YAML (#23908)
* Better handle file not found * Lint
This commit is contained in:
1 parent
f991ec15f2
commit
e356d0bcda
4 files changed
+11
-11
No files matched your search
@@ -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