Skip to content

Commit cb63b12

Browse files
[HttpClient] display proper error message on TransportException when curl is used
1 parent 1cd99ea commit cb63b12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpClient/Response/CurlResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private static function perform(CurlClientState $multi, array &$responses = null
245245

246246
while ($info = curl_multi_info_read($multi->handle)) {
247247
$multi->handlesActivity[(int) $info['handle']][] = null;
248-
$multi->handlesActivity[(int) $info['handle']][] = \in_array($info['result'], [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || (\CURLE_WRITE_ERROR === $info['result'] && 'destruct' === @curl_getinfo($info['handle'], CURLINFO_PRIVATE)) ? null : new TransportException(curl_error($info['handle']));
248+
$multi->handlesActivity[(int) $info['handle']][] = \in_array($info['result'], [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || (\CURLE_WRITE_ERROR === $info['result'] && 'destruct' === @curl_getinfo($info['handle'], CURLINFO_PRIVATE)) ? null : new TransportException(curl_strerror($info['result']).' for '.curl_getinfo($info['handle'], CURLINFO_EFFECTIVE_URL));
249249
}
250250
} finally {
251251
self::$performing = false;

0 commit comments

Comments
 (0)