Skip to content

Commit 268b217

Browse files
author
Oleksii Korshenko
authored
MAGETWO-67500: setup:di:compile returns exit code 0 if errors are found #7780
2 parents 5112cfb + e4276a7 commit 268b217

File tree

1 file changed

+6
-0
lines changed
  • setup/src/Magento/Setup/Module/Di/Compiler/Log

1 file changed

+6
-0
lines changed

setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,17 @@ public function add($type, $key, $message = '')
8080
* Write entries
8181
*
8282
* @return void
83+
* @throws \Magento\Framework\Validator\Exception
8384
*/
8485
public function report()
8586
{
8687
$this->_successWriter->write($this->_successEntries);
8788
$this->_errorWriter->write($this->_errorEntries);
89+
//do not take into account empty items since they are initialized in constructor.
90+
$errors = array_filter($this->_errorEntries);
91+
if (count($errors) > 0) {
92+
throw new \Magento\Framework\Validator\Exception(__('Error during compilation'));
93+
}
8894
}
8995

9096
/**

0 commit comments

Comments
 (0)