Skip to content
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

[9.x] Http client: retry callback exception handling (follow-up to #41762) #41792

Conversation

gdebrauwer
Copy link
Contributor

Follow-up to #41762.

Because the retryWhenCallback is now executed inside the global retry helper method, an extra attempt would be made if an exception occurred in the retryWhenCallback. This was not the case when the retryWhenCallback was used as a callback by the global retry helper method.
By wrapping it in a try-catch, we can set $shouldRetry to false before we throw the exception again. This ensures it does not make an unnecessary attempt.

@gdebrauwer gdebrauwer changed the title Http client retry callback exception handling [9.x] Http client: retry callback exception handling Apr 2, 2022
@gdebrauwer gdebrauwer changed the title [9.x] Http client: retry callback exception handling [9.x] Http client: retry callback exception handling (follow-up to #41762) Apr 2, 2022
@taylorotwell taylorotwell merged commit 9879b90 into laravel:9.x Apr 2, 2022
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.

None yet

2 participants