mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add link to error message (#3530)
This commit is contained in:
parent
00e298206e
commit
a084232cf5
@ -397,16 +397,21 @@ def _ensure_loader_prepared(hass: core.HomeAssistant) -> None:
|
|||||||
def log_exception(ex, domain, config):
|
def log_exception(ex, domain, config):
|
||||||
"""Generate log exception for config validation."""
|
"""Generate log exception for config validation."""
|
||||||
message = 'Invalid config for [{}]: '.format(domain)
|
message = 'Invalid config for [{}]: '.format(domain)
|
||||||
|
|
||||||
if 'extra keys not allowed' in ex.error_message:
|
if 'extra keys not allowed' in ex.error_message:
|
||||||
message += '[{}] is an invalid option for [{}]. Check: {}->{}.'\
|
message += '[{}] is an invalid option for [{}]. Check: {}->{}.'\
|
||||||
.format(ex.path[-1], domain, domain,
|
.format(ex.path[-1], domain, domain,
|
||||||
'->'.join('%s' % m for m in ex.path))
|
'->'.join('%s' % m for m in ex.path))
|
||||||
else:
|
else:
|
||||||
message += humanize_error(config, ex)
|
message += '{}.'.format(humanize_error(config, ex))
|
||||||
|
|
||||||
if hasattr(config, '__line__'):
|
if hasattr(config, '__line__'):
|
||||||
message += " (See {}:{})".format(config.__config_file__,
|
message += " (See {}:{})".format(
|
||||||
config.__line__ or '?')
|
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)
|
_LOGGER.error(message)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user