From 5bd57ee255ffe5fd5cf124d19df084a832b53d3b Mon Sep 17 00:00:00 2001 From: evilsocket Date: Thu, 8 Feb 2018 08:30:27 +0100 Subject: [PATCH] fix: using a clearer error message when a module parameter is not valid --- session/module_param.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/module_param.go b/session/module_param.go index 50c6bab8..a83a401d 100644 --- a/session/module_param.go +++ b/session/module_param.go @@ -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("%s: value '%s' does not validate '%s'.", core.Bold(p.Name), value, p.Validator.String()), nil + return fmt.Errorf("Parameter %s not valid: '%s' does not match rule '%s'.", core.Bold(p.Name), value, p.Validator.String()), nil } }