Log errors when loading yaml (#6257)

This commit is contained in:
Johann Kellerman 2017-03-01 06:56:23 +02:00 committed by GitHub
parent a0256e1947
commit ac49298c8d
4 changed files with 25 additions and 9 deletions

View file

@ -239,7 +239,11 @@ def load_yaml_config_file(config_path):
This method needs to run in an executor.
"""
conf_dict = load_yaml(config_path)
try:
conf_dict = load_yaml(config_path)
except FileNotFoundError as err:
raise HomeAssistantError("Config file not found: {}".format(
getattr(err, 'filename', err)))
if not isinstance(conf_dict, dict):
msg = 'The configuration file {} does not contain a dictionary'.format(