<?php
/**
 * Unauthorized exception class.
 *
 * @package PDFDraft
 */

namespace PDFDraft\Exceptions;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Exception thrown when a user is not authorized to perform an action.
 */
class UnauthorizedException extends ServiceException {

	// phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod.Found -- Provides default message and code for unauthorized access.
	/**
	 * Constructor.
	 *
	 * @param string     $message  Exception message.
	 * @param int        $code     HTTP status code.
	 * @param \Throwable $previous Previous exception.
	 */
	public function __construct( string $message = 'Unauthorized access', int $code = 403, ?\Throwable $previous = null ) { // phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod.Found -- provides default values
		parent::__construct( $message, $code, $previous );
	}
}
