Skip to content

Custom exception message when using middleware api.throttle #1168

Open
@Luddinus

Description

@Luddinus

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"

throw new HttpException(403, 'You have exceeded your rate limit.', null, $this->getHeaders());

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions