优化WAF规则错误提示

This commit is contained in:
GoEdgeLab
2021-09-25 19:58:17 +08:00
parent d2bf6690b2
commit 723f449a4c

View File

@@ -27,12 +27,12 @@ func (this *HTTPFirewallRule) Init() error {
case HTTPFirewallRuleOperatorMatch:
_, err := regexp.Compile(this.Value)
if err != nil {
return errors.New("regexp validate failed: " + err.Error())
return errors.New("regexp validate failed: " + err.Error() + ", expression: " + this.Value)
}
case HTTPFirewallRuleOperatorNotMatch:
_, err := regexp.Compile(this.Value)
if err != nil {
return errors.New("regexp validate failed: " + err.Error())
return errors.New("regexp validate failed: " + err.Error() + ", expression: " + this.Value)
}
}