From a084232cf5f4c2402e621e75a91394ed9245c39e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2016 08:59:34 +0200 Subject: [PATCH] Add link to error message (#3530) --- homeassistant/bootstrap.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index d1ac26250aa..b2c1d256c4a 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -397,16 +397,21 @@ def _ensure_loader_prepared(hass: core.HomeAssistant) -> None: def log_exception(ex, domain, config): """Generate log exception for config validation.""" message = 'Invalid config for [{}]: '.format(domain) + if 'extra keys not allowed' in ex.error_message: message += '[{}] is an invalid option for [{}]. Check: {}->{}.'\ .format(ex.path[-1], domain, domain, '->'.join('%s' % m for m in ex.path)) else: - message += humanize_error(config, ex) + message += '{}.'.format(humanize_error(config, ex)) if hasattr(config, '__line__'): - message += " (See {}:{})".format(config.__config_file__, - config.__line__ or '?') + message += " (See {}:{})".format( + config.__config_file__, config.__line__ or '?') + + if domain != 'homeassistant': + message += (' Please check the docs at ' + 'https://home-assistant.io/components/{}/'.format(domain)) _LOGGER.error(message)