8000 Add failWhen method to ThrottlesExceptions job middleware by michaeldzjap · Pull Request #56180 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

Add failWhen method to ThrottlesExceptions job middleware #56180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 1, 2025

Conversation

michaeldzjap
Copy link
Contributor
@michaeldzjap michaeldzjap commented Jun 30, 2025

This PR adds a failWhen method to the ThrottlesExceptions job middleware. Currently, this middleware only allows for deleting the job when a specific exception is thrown. There are occasions were you would want to mark the job as failed instead. For instance: in the context of a job chain it may be desirable to fail a job when an exception is thrown so that the chain stops executing. With the current deleteWhen method this is not possible.

See discussion #56174 for more context.

Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@michaeldzjap michaeldzjap marked this pull request as ready for review June 30, 2025 17:16
@michaeldzjap michaeldzjap marked this pull request as draft June 30, 2025 17:18
@michaeldzjap michaeldzjap marked this pull request as ready for review June 30, 2025 17:20
@taylorotwell taylorotwell merged commit 2cd7ba9 into laravel:12.x Jul 1, 2025
39 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0