Creates a ResponseException from invalid data in an API response.
Parameters
$apiNamestringrequired- The name of the API service (e.g.,
'OpenAI','Anthropic'). $fieldNamestringrequired- The field that was invalid.
$messagestringrequired- The specific error message describing the invalid data.
Source
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));
}
Changelog
| Version | Description |
|---|---|
| 0.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.