added the triggered rate limit rule in the error log details

This commit is contained in:
Gani Georgiev
2025-06-25 20:32:51 +03:00
parent 3f3b77dcd4
commit 2c6f99418f
4 changed files with 56 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
package apis
import (
"errors"
"sync"
"time"
@@ -167,7 +168,7 @@ func checkRateLimit(e *core.RequestEvent, rtId string, rule core.RateLimitRule)
}
if !rt.isAllowed(key) {
return e.TooManyRequestsError("", nil)
return e.TooManyRequestsError("", errors.New("triggered rate limit rule: "+rule.String()))
}
return nil