private function CurlMulti::isCurlException

Check if a cURL transfer resulted in what should be an exception

Parameters

RequestInterface $request Request to check:

CurlHandle $handle Curl handle object:

array $curl Array returned from curl_multi_info_read:

Return value

\Exception|bool

1 call to CurlMulti::isCurlException()
CurlMulti::processResponse in drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php
Check for errors and fix headers of a request based on a curl response

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php, line 588

Class

CurlMulti
Send { This implementation allows callers to send blocking requests that return back to the caller when their requests complete, regardless of whether or not previously sending requests in the curl_multi object have completed. The implementation…

Namespace

Guzzle\Http\Curl

Code

private function isCurlException(RequestInterface $request, CurlHandle $handle, array $curl) {
  if (CURLM_OK == $curl['result'] || CURLM_CALL_MULTI_PERFORM == $curl['result']) {
    return false;
  }
  $handle
    ->setErrorNo($curl['result']);
  $e = new CurlException(sprintf('[curl] %s: %s [url] %s', $handle
    ->getErrorNo(), $handle
    ->getError(), $handle
    ->getUrl()));
  $e
    ->setCurlHandle($handle)
    ->setRequest($request)
    ->setCurlInfo($handle
    ->getInfo())
    ->setError($handle
    ->getError(), $handle
    ->getErrorNo());
  return $e;
}