getHandlerContext(); return !empty($context['errno']) && $context['errno'] === self::CURLE_RECV_ERROR; } return false; } public static function getResponse(\Throwable $exception): ?ResponseInterface { // Guzzle 8: response-aware failures expose the response through ResponseException. if ($exception instanceof ResponseException) { return $exception->getResponse(); } // Guzzle 7: RequestException directly carried an optional response. if ($exception instanceof RequestException && is_callable([$exception, 'getResponse']) ) { return $exception->getResponse(); } return null; } }