<?php

declare(strict_types=1);

namespace PHPMax\Exception;







class SessionRevokedException extends PHPMaxException
{
     
    private $reason;

    public function __construct(string $reason, ?\Throwable $previous = null)
    {
        $this->reason = $reason !== '' ? $reason : 'max_session_rejected';
        parent::__construct('MAX session was revoked: ' . $this->reason, 0, $previous);
    }

    public function reason(): string
    {
        return $this->reason;
    }
}
