From 3a29ca1fbbe7bc9e5fc0c75110e5811e3bb6ad63 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Thu, 8 Feb 2018 08:29:37 +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 1061e16c..50c6bab8 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("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 } }