HEX
Server: Apache
System: Linux d5123.usc1.stableserver.net 5.14.0-570.17.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Sat May 24 12:53:17 EDT 2025 x86_64
User: d5123 (1001)
PHP: 8.4.21
Disabled: NONE
Upload Files
File: /home/d5123/myboofola_com/wp-content/plugins/woocommerce/src/Api/AuthorizationException.php
<?php

declare(strict_types=1);

namespace Automattic\WooCommerce\Api;

/**
 * Thrown from an authorize() method to deny access with a custom error message.
 *
 * Uses a fixed UNAUTHORIZED error code and 401 status. The message defaults to
 * a generic denial but can be overridden for more specific feedback.
 */
class AuthorizationException extends ApiException {
	/**
	 * Constructor.
	 *
	 * @param string      $message  The error message.
	 * @param ?\Throwable $previous The previous throwable for chaining.
	 */
	public function __construct(
		string $message = 'You do not have permission to perform this action.',
		?\Throwable $previous = null,
	) {
		parent::__construct( $message, 'UNAUTHORIZED', array(), 401, $previous );
	}
}