# wordpress-seo/28.5/src/ai/http-request/domain/exceptions/wp-request-exception.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version 28.5. 27 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/28.5/code/src/ai/http-request/domain/exceptions/wp-request-exception.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/28.5/raw/src/ai/http-request/domain/exceptions/wp-request-exception.php
- Modified: 2026-03-17T12:01:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wordpress-seo/28.5/code/src/ai/http-request/domain/exceptions/wp-request-exception.php#L10-L20`.

```php
<?php

// phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded

// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\AI\HTTP_Request\Domain\Exceptions;

use Throwable;

/**
 * Class to manage an error response in wp_remote_*() requests.
 *
 * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
 */
class WP_Request_Exception extends Remote_Request_Exception {

	/**
	 * WP_Request_Exception constructor.
	 *
	 * @param string          $message  The error message.
	 * @param Throwable| null $previous The previously thrown exception.
	 */
	public function __construct( $message = '', $previous = null ) {
		parent::__construct( $message, 400, 'WP_HTTP_REQUEST_ERROR', $previous );
	}
}

```
