/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlock.php
63 строки
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ namespace Magento\Framework\View\Element; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Phrase; /** * Class of a Exception Handler Block * * Block for default and maintenance mode. During layout loading process corrupted block (that throws exception) * will be replaced with a "dummy" block. As result, page will be loaded without broken block. * * When calls from parent to child block occurred and the error appeared in the child block, * all blocks chain would be removed. */ class ExceptionHandlerBlock implements BlockInterface { /** * @var string */ protected $blockName; /** * @param string $blockName */ public function __construct($blockName = '') { $this->blockName = $blockName; } /** * Throws an exception when parent block calls corrupted child block method * * @param string $method * @param array $args * @return void * @throws LocalizedException */ public function __call($method, $args) { throw new LocalizedException( new Phrase('The "%1" block threw an exception, and it can\'t be rendered.', [$this->blockName]) ); } /** * Declared in BlockInterface and also throws an exception * * @throws LocalizedException * @return void */ public function toHtml() { throw new LocalizedException( new Phrase('The "%1" block threw an exception, and it can\'t be rendered.', [$this->blockName]) ); } }