HEX
Server: LiteSpeed
System: Linux s882.use1.mysecurecloudhost.com 4.18.0-553.27.1.lve.el8.x86_64 #1 SMP Fri Nov 8 15:09:45 UTC 2024 x86_64
User: airservicecom (4307)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/airservicecom/public_html/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 );
	}
}