CannotSwitchStoreException.php 688 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\Store\Model\StoreSwitcher;
  8. use Magento\Framework\Exception\RuntimeException;
  9. use Magento\Framework\Phrase;
  10. /**
  11. * Exception thrown if store cannot be switched.
  12. */
  13. class CannotSwitchStoreException extends RuntimeException
  14. {
  15. /**
  16. * @param \Exception|null $cause
  17. * @param Phrase|null $phrase
  18. * @param int $code
  19. */
  20. public function __construct(\Exception $cause = null, Phrase $phrase = null, int $code = 0)
  21. {
  22. parent::__construct($phrase ?: __('The store cannot be switched.'), $cause, $code);
  23. }
  24. }