-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Description
Existing Behavior: When Magento 2 encounters a parsing error in a layout handle XML file, it logs the error here.
#File: lib/internal/Magento/Framework/View/Model/Layout/Merge.php
protected function _logXmlErrors($fileName, $libXmlErrors)
{
$errors = [];
if (count($libXmlErrors)) {
foreach ($libXmlErrors as $error) {
$errors[] = "{$error->message} Line: {$error->line}";
}
$this->logger->info(
sprintf("Theme layout update file '%s' is not valid.\n%s", $fileName, implode("\n", $errors))
);
}
}
and then continues with system execution.
Requested Behavior: When developer mode is enabled, this should be a "hard crash" instead (throwing an exception?). i.e. If a developer's working on their system with developer mode on, and they make a mistake in a layout handle configuration file, the system should halt execution and tell at them about their bad XML.
This would match Magento 1.x behavior, as well as follow the general "fail fast" principle exposed in certain corners of the software development world.