dingo / dingo/api

Custom exception message when using middleware api.throttle

Open
#1,168 13 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
PHP
Stars
9.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm using the api.throttle middleware when a user tries to login the application.

If he passed the rate limit, the middleware throws an HttpException, with the message "You have exceed your rate limit"

https://github.com/dingo/api/blob/b0491204a4f9c6ac305f344a0d30954175002364/src/Http/Middleware/RateLimit.php#L67

So, how can I change that message ONLY in this route? I know I can do custom exceptions, but in this case, the Exception is already fired so, any ideas?

Thx.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.