WordPress\AiClient\Providers\Http\Exception
ResponseException::fromInvalidData
Creates a ResponseException from invalid data in an API response.
Метод класса: ResponseException{}
Хуков нет.
Возвращает
self.
Использование
$result = ResponseException::fromInvalidData( $apiName, $fieldName, $message ): self;
- $apiName(строка) (обязательный)
- The name of the API service (e.g.,
'OpenAI', 'Anthropic'). - $fieldName(строка) (обязательный)
- The field that was invalid.
- $message(строка) (обязательный)
- The specific error message describing the invalid data.
Список изменений
| С версии 0.2.0 | Введена. |
Код ResponseException::fromInvalidData() ResponseException::fromInvalidData WP 7.1.2
public static function fromInvalidData(string $apiName, string $fieldName, string $message): self
{
return new self(sprintf('Unexpected %s API response: Invalid "%s" key: %s', $apiName, $fieldName, $message));
}