Skip to content

Commit 8c4667a

Browse files
committed
magento/magento-2#23222: setup:upgrade should return failure when app:config:import failed: Added logic to throw RuntimeException if app:config:import returns failure error code
1 parent 6e534ad commit 8c4667a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setup/src/Magento/Setup/Console/Command/UpgradeCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
126126
$importConfigCommand = $this->getApplication()->find(ConfigImportCommand::COMMAND_NAME);
127127
$arrayInput = new ArrayInput([]);
128128
$arrayInput->setInteractive($input->isInteractive());
129-
$importConfigCommand->run($arrayInput, $output);
129+
$result = $importConfigCommand->run($arrayInput, $output);
130+
if ($result === \Magento\Framework\Console\Cli::RETURN_FAILURE) {
131+
throw new \Magento\Framework\Exception\RuntimeException(__(ConfigImportCommand::COMMAND_NAME . ' failed. See previous output.'));
132+
}
130133
}
131134

132135
if (!$keepGenerated && $this->appState->getMode() === AppState::MODE_PRODUCTION) {

0 commit comments

Comments
 (0)