WordPress\AiClient\Providers\Http\Exception

NetworkException::getRequestpublicWP 0.2.0

Returns the request that failed as our Request DTO.

Method of the class: NetworkException{}

No Hooks.

Returns

Request.

Usage

$NetworkException = new NetworkException();
$NetworkException->getRequest(): Request;

Changelog

Since 0.2.0 Introduced.

NetworkException::getRequest() code WP 7.0

public function getRequest(): Request
{
    if ($this->request === null) {
        throw new \RuntimeException('Request object not available. This exception was directly instantiated. ' . 'Use a factory method that provides request context.');
    }
    return $this->request;
}