<?php

namespace AutoAdmin\Bundle\Admin\Exception;

use AutoAdmin\Bundle\Admin\Helper\FlashbagHelper;
use Exception;

class UnknownToastLevelException extends Exception
{
    public function __construct(string $level)
    {
        $authorizedLevels = implode(', ', FlashbagHelper::AUTHORIZED_LEVELS);

        parent::__construct(
            sprintf("The level \"%s\" is not defined, please use one of these levels " . $authorizedLevels, $level),
            0,
            null
        );
    }
}
