WordPress\AiClient\Providers\Http\Exception

ResponseException::fromMissingData │ public static │ WP 0.2.0

Creates a ResponseException for missing expected data.

Метод класса: ResponseException{}

Хуков нет.

Возвращает

self.

Использование

$result = ResponseException::fromMissingData( $apiName, $fieldName ): self;
$apiName(строка) (обязательный)
The name of the API/provider.
$fieldName(строка) (обязательный)
The field that was expected but missing.

Список изменений

С версии 0.2.0 Введена.

Код ResponseException::fromMissingData() WP 7.1.2

public static function fromMissingData(string $apiName, string $fieldName): self
{
    $message = sprintf('Unexpected %s API response: Missing the "%s" key.', $apiName, $fieldName);
    return new self($message);
}