Log in
Model

CannotSwitchStoreException

Magento\Store\Model\StoreSwitcher\CannotSwitchStoreException

What it does

This is a custom exception class thrown when Magento cannot switch between store views, typically during multi-store operations or when a customer tries to access a store they don't have permission to view.

Developers should catch this exception when implementing store switching functionality to handle edge cases where the switch fails due to configuration issues, permissions, or invalid store codes.