wp-includes/php-ai-client/src/Providers/Http/Util/ResponseUtil.php:35Throws an appropriate exception if the given response is not successful.
$responseWordPress\AiClient\Providers\Http\DTO\Response public static function throwIfNotSuccessful(Response $response): void { if ($response->isSuccessful()) { return; } $statusCode = $response->getStatusCode(); // 3xx Redirect Responses if ($statusCode >= 300 && $statusCode < 400) { throw RedirectException::fromRedirectResponse($response); } // 4xx Client Errors if ($statusCode >= 400 && $statusCode < 500) { throw ClientException::fromClientErrorResponse($response); } // 5xx Server Errors if ($statusCode >= 500 && $statusCode < 600) { throw ServerException::fromServerErrorResponse($response); } throw new \RuntimeException(sprintf('Response returned invalid status code: %s', $response->getStatusCode())); }Introduced in 0.1.0. Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
src/wp-includes/php-ai-client/src/Providers/Http/Util/ResponseUtil.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.