Skip to content

Commit 3ca9e94

Browse files
committed
MC-17992: [Backport] Error in app:config:import isn't logged during setup:upgrade
1 parent f4241d2 commit 3ca9e94

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ protected function configure()
8787
protected function execute(InputInterface $input, OutputInterface $output)
8888
{
8989
try {
90+
$resultCode = \Magento\Framework\Console\Cli::RETURN_SUCCESS;
9091
$keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED);
9192
$installer = $this->installerFactory->create(new ConsoleLogger($output));
9293
$installer->updateModulesSequence($keepGenerated);
@@ -97,15 +98,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
9798
$importConfigCommand = $this->getApplication()->find(ConfigImportCommand::COMMAND_NAME);
9899
$arrayInput = new ArrayInput([]);
99100
$arrayInput->setInteractive($input->isInteractive());
100-
$result = $importConfigCommand->run($arrayInput, $output);
101-
if ($result === \Magento\Framework\Console\Cli::RETURN_FAILURE) {
102-
throw new \Magento\Framework\Exception\RuntimeException(
103-
__('%1 failed. See previous output.', ConfigImportCommand::COMMAND_NAME)
104-
);
105-
}
101+
$resultCode = $importConfigCommand->run($arrayInput, $output);
106102
}
107103

108-
if (!$keepGenerated && $this->appState->getMode() === AppState::MODE_PRODUCTION) {
104+
if ($resultCode !== \Magento\Framework\Console\Cli::RETURN_FAILURE
105+
&& !$keepGenerated && $this->appState->getMode() === AppState::MODE_PRODUCTION) {
109106
$output->writeln(
110107
'<info>Please re-run Magento compile command. Use the command "setup:di:compile"</info>'
111108
);
@@ -115,6 +112,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
115112
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
116113
}
117114

118-
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
115+
return $resultCode;
119116
}
120117
}

0 commit comments

Comments
 (0)