-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] Calling $httpClient->request(...) can result in unexpected exceptions #35458
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
Comments
Can you provide a reproducer that would lead to an empty message? |
So I would consider changing this design, because there are situations when some action need to be ended and i shouldn't need to care if there are somewhere unacked responses. I will try to reproduce this missing |
Unfortunately, cancelling request in |
…celed responses (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] fix HttpClientDataCollector when handling canceled responses | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #35458 | License | MIT | Doc PR | - Commits ------- 303f9e5 [HttpClient] fix HttpClientDataCollector when handling canceled responses
Symfony version(s) affected: Probably 4.4 / 5.0
Description
Calling
$httpClient->request(...)
(using Curl client) results in immediately destroyedCurlResponse
object, which calls during destroyingcheckStatusCode
method fromResponseTrait
if no$this->info['error']
is set. Problem is that when request timed out overmax_duration
,$this->info['error']
can be empty (error message is shown indebug
IIRC) and checking for status code throws exception.How to reproduce
Possible Solution
Do not check status code in
doDestruct
method, fix empty$info['error']
when request timed out overmax_duration
.The text was updated successfully, but these errors were encountered: