fix: using a clearer error message when a module parameter is not valid

This commit is contained in:
evilsocket 2018-02-08 08:29:37 +01:00
commit 3a29ca1fbb

View file

@ -59,7 +59,7 @@ func NewIntParameter(name string, def_value string, desc string) *ModuleParam {
func (p ModuleParam) Validate(value string) (error, interface{}) {
if p.Validator != nil {
if p.Validator.MatchString(value) == false {
return fmt.Errorf("Parameter value '%s' does not match validator '%s'.", value, p.Validator.String()), nil
return fmt.Errorf("%s: value '%s' does not validate '%s'.", core.Bold(p.Name), value, p.Validator.String()), nil
}
}