<?php

declare(strict_types=1);

namespace App\Administration\Domain\Exception;

use DomainException;

use function sprintf;

/**
 * Thrown when a token consumption is already in progress.
 *
 * This indicates a concurrent request is processing the same token,
 * and the client should retry after a short delay.
 */
final class TokenConsumptionInProgressException extends DomainException
{
    public function __construct(string $tokenValue)
    {
        parent::__construct(
            sprintf('Token consumption in progress for token "%s". Please retry.', $tokenValue)
        );
    }
}
