| Server IP : 3.93.235.159 / Your IP : 216.73.216.140 Web Server : Apache System : Linux ip-172-26-0-169 5.10.0-46-cloud-amd64 #1 SMP Debian 5.10.262-1 (2026-07-31) x86_64 User : bitnami ( 1000) PHP Version : 8.2.9 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/pojo-accessibility/classes/client/ |
Upload File : |
<?php
namespace EA11y\Classes\Client;
use Exception;
use EA11y\Classes\Exceptions\Quota_Exceeded_Error;
use EA11y\Classes\Exceptions\Quota_API_Error;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
class Client_Response {
private array $known_errors;
/**
* @var mixed
*/
private $response;
/**
* @throws Quota_API_Error|Quota_Exceeded_Error|Exception
*/
public function handle() {
if ( ! is_wp_error( $this->response ) ) {
return $this->response;
}
$message = $this->response->get_error_message();
if ( isset( $this->known_errors[ $message ] ) ) {
throw $this->known_errors[ $message ];
}
throw new Exception( $message );
}
public function __construct( $response ) {
$this->known_errors = [
"Quota Status Guard Request Failed!: plan.features.ai_credits Quota exceeded" => new Quota_Exceeded_Error(),
"Quota Api Request Failed!: Failed checking if allowed to use quota" => new Quota_API_Error(),
];
$this->response = $response;
}
}