Show example (when available) for "invalid value" error
This commit is contained in:
parent
229a45a491
commit
e814494777
1 changed files with 6 additions and 1 deletions
|
@ -169,6 +169,11 @@ class Module(ModuleManager.BaseModule):
|
||||||
try:
|
try:
|
||||||
result = self._config(export_settings, target, setting, value)
|
result = self._config(export_settings, target, setting, value)
|
||||||
except ConfigInvalidValue:
|
except ConfigInvalidValue:
|
||||||
|
example = setting_info.get("example", None)
|
||||||
|
if not example == None:
|
||||||
|
raise utils.EventError("Invalid value. Example: %s" %
|
||||||
|
example)
|
||||||
|
else:
|
||||||
raise utils.EventError("Invalid value")
|
raise utils.EventError("Invalid value")
|
||||||
except ConfigSettingInexistent:
|
except ConfigSettingInexistent:
|
||||||
raise utils.EventError("Setting not set")
|
raise utils.EventError("Setting not set")
|
||||||
|
|
Loading…
Reference in a new issue