improve error message for wrong config section names

This commit is contained in:
Benedikt Hegner 2016-05-11 13:29:27 +02:00
parent 3d3a520a7d
commit 0b7b25487f

View File

@ -269,10 +269,10 @@
def validate_section_name(section):
"""Raise a ValueError if the section is not a valid section."""
"""Exit if the section is not a valid section."""
if section not in section_schemas:
raise ValueError("Invalid config section: '%s'. Options are %s"
% (section, section_schemas))
tty.die("Invalid config section: '%s'. Options are: %s"
% (section, " ".join(section_schemas.keys())))
def extend_with_default(validator_class):