CannotSwitchStoreException.php 688 Bytes
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Magento\Store\Model\StoreSwitcher;

use Magento\Framework\Exception\RuntimeException;
use Magento\Framework\Phrase;

/**
 * Exception thrown if store cannot be switched.
 */
class CannotSwitchStoreException extends RuntimeException
{
    /**
     * @param \Exception|null $cause
     * @param Phrase|null $phrase
     * @param int $code
     */
    public function __construct(\Exception $cause = null, Phrase $phrase = null, int $code = 0)
    {
        parent::__construct($phrase ?: __('The store cannot be switched.'), $cause, $code);
    }
}