mirror of
https://github.com/bettercap/bettercap
synced 2025-07-11 23:57:01 -07:00
fix: using a clearer error message when a module parameter is not valid
This commit is contained in:
parent
3a29ca1fbb
commit
5bd57ee255
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ func NewIntParameter(name string, def_value string, desc string) *ModuleParam {
|
||||||
func (p ModuleParam) Validate(value string) (error, interface{}) {
|
func (p ModuleParam) Validate(value string) (error, interface{}) {
|
||||||
if p.Validator != nil {
|
if p.Validator != nil {
|
||||||
if p.Validator.MatchString(value) == false {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue