YoastSEO_Vendor\GuzzleHttp\Handler
CurlFactory::createRejection() private Yoast 1.0
{} Это метод класса: CurlFactory{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$result = CurlFactory::createRejection( \YoastSEO_Vendor\GuzzleHttp\Handler\EasyHandle $easy, $ctx );
Код CurlFactory::createRejection() CurlFactory::createRejection Yoast 15.6.2
private static function createRejection(\YoastSEO_Vendor\GuzzleHttp\Handler\EasyHandle $easy, array $ctx)
{
static $connectionErrors = [\CURLE_OPERATION_TIMEOUTED => \true, \CURLE_COULDNT_RESOLVE_HOST => \true, \CURLE_COULDNT_CONNECT => \true, \CURLE_SSL_CONNECT_ERROR => \true, \CURLE_GOT_NOTHING => \true];
// If an exception was encountered during the onHeaders event, then
// return a rejected promise that wraps that exception.
if ($easy->onHeadersException) {
return \YoastSEO_Vendor\GuzzleHttp\Promise\rejection_for(new \YoastSEO_Vendor\GuzzleHttp\Exception\RequestException('An error was encountered during the on_headers event', $easy->request, $easy->response, $easy->onHeadersException, $ctx));
}
$message = \sprintf('cURL error %s: %s (%s)', $ctx['errno'], $ctx['error'], 'see http://curl.haxx.se/libcurl/c/libcurl-errors.html');
// Create a connection exception if it was a specific error code.
$error = isset($connectionErrors[$easy->errno]) ? new \YoastSEO_Vendor\GuzzleHttp\Exception\ConnectException($message, $easy->request, null, $ctx) : new \YoastSEO_Vendor\GuzzleHttp\Exception\RequestException($message, $easy->request, $easy->response, null, $ctx);
return \YoastSEO_Vendor\GuzzleHttp\Promise\rejection_for($error);
}