Skip to content

Commit 5513444

Browse files
committed
Revert "Throw a \RuntimeException whenever a curl request fails (sendgrid#90)"
This reverts commit 74f74c3.
1 parent 74f74c3 commit 5513444

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

lib/Client.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,6 @@ private function parseResponse($channel, $content)
415415
$headerSize = curl_getinfo($channel, CURLINFO_HEADER_SIZE);
416416
$statusCode = curl_getinfo($channel, CURLINFO_HTTP_CODE);
417417

418-
if ($statusCode === 0) {
419-
throw new \RuntimeException(curl_error($channel));
420-
}
421-
422418
$responseBody = substr($content, $headerSize);
423419

424420
$responseHeaders = substr($content, 0, $headerSize);
@@ -457,8 +453,6 @@ private function retryRequest(array $responseHeaders, $method, $url, $body, $hea
457453
* @param bool $retryOnLimit should retry if rate limit is reach?
458454
*
459455
* @return Response object
460-
*
461-
* @throws \RuntimeException
462456
*/
463457
public function makeRequest($method, $url, $body = null, $headers = null, $retryOnLimit = false)
464458
{
@@ -487,8 +481,6 @@ public function makeRequest($method, $url, $body = null, $headers = null, $retry
487481
* @param array $requests
488482
*
489483
* @return Response[]
490-
*
491-
* @throws \RuntimeException
492484
*/
493485
public function makeAllRequests(array $requests = [])
494486
{

test/unit/ClientTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,6 @@ public function testCreateCurlOptionsWithBodyAndHeaders()
195195
], $result);
196196
}
197197

198-
/**
199-
* @expectedException \RuntimeException
200-
* @expectedExceptionMessageRegExp /SSL certificate problem/i
201-
*/
202-
public function testMakeRequestWithUntrustedRootCert()
203-
{
204-
$client = new Client('https://untrusted-root.badssl.com/');
205-
$client->makeRequest('GET', 'https://untrusted-root.badssl.com/');
206-
}
207-
208198
/**
209199
* @param object $obj
210200
* @param string $name

0 commit comments

Comments
 (0)