Simplify error message

This commit is contained in:
Markus Unterwaditzer 2015-07-05 16:13:54 +02:00
parent a446307d44
commit c9cc6e2aed

View file

@ -44,9 +44,10 @@ def catch_errors(f):
def validate_verbosity(ctx, param, value):
x = getattr(log.logging, value.upper(), None)
if x is None:
raise click.BadParameter('Invalid verbosity value {}. Must be '
'CRITICAL, ERROR, WARNING, INFO or DEBUG'
.format(value))
raise click.BadParameter(
'Must be CRITICAL, ERROR, WARNING, INFO or DEBUG, not {}'
.format(value)
)
return x