Better handle file not found when loading YAML (#23908)

* Better handle file not found

* Lint
This commit is contained in:
Paulus Schoutsen
2019-05-19 12:01:29 +02:00
committed by GitHub
parent f991ec15f2
commit e356d0bcda
4 changed files with 11 additions and 11 deletions

View File

@@ -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))