| 1 |
<?php |
| 2 |
|
| 3 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded |
| 4 |
|
| 5 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. |
| 6 |
namespace Yoast\WP\SEO\AI\HTTP_Request\Domain\Exceptions; |
| 7 |
|
| 8 |
/** |
| 9 |
* Thrown when the AI service rejects a request with a 403 because the user's consent is required. |
| 10 |
* |
| 11 |
* Distinct from a generic {@see Forbidden_Exception} because the recovery path differs and because |
| 12 |
* the fallback must be skipped: the consent state is an authoritative answer about this user, so |
| 13 |
* trying the secondary auth strategy (which talks to the same service for the same user) is |
| 14 |
* pointless and can mask the real signal with an unrelated failure. The caller clears local consent |
| 15 |
* and re-prompts the user. The service carries no machine-readable discriminator for this case, so |
| 16 |
* it is classified from the 403 response message — see {@see \Yoast\WP\SEO\AI\Authentication\Application\OAuth_Auth_Strategy}. |
| 17 |
*/ |
| 18 |
class Consent_Required_Exception extends Forbidden_Exception { |
| 19 |
|
| 20 |
} |
| 21 |
|