Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CurlFactory.php

function CurlFactory::finishError

Parameters

callable(RequestInterface, array): PromiseInterface $handler:

1 call to CurlFactory::finishError()
CurlFactory::finish in vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
Completes a cURL transaction, either returning a response promise or a rejected promise.

File

vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php, line 189

Class

CurlFactory
Creates curl resources from a request

Namespace

GuzzleHttp\Handler

Code

private static function finishError(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory) : PromiseInterface {
    // Get error information and release the handle to the factory.
    $ctx = [
        'errno' => $easy->errno,
        'error' => \curl_error($easy->handle),
        'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME),
    ] + \curl_getinfo($easy->handle);
    $ctx[self::CURL_VERSION_STR] = self::getCurlVersion();
    $factory->release($easy);
    // Retry when nothing is present or when curl failed to rewind.
    if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) {
        return self::retryFailedRewind($handler, $easy, $ctx);
    }
    return self::createRejection($easy, $ctx);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal