Skip to content

Commit fd12fa9

Browse files
Merge pull request #403 from magento-jackalopes/MAGETWO-52837-command-return-nonzero-on-failure
[Jackalopes] Magetwo 52837 command return nonzero on failure (2.2 release)
2 parents a276241 + b68b46e commit fd12fa9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/Catalog/Console/Command/ProductAttributesCleanUp.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
101101
$output->writeln("");
102102
$output->writeln("<info>Unused product attributes successfully cleaned up:</info>");
103103
$output->writeln("<comment> " . implode("\n ", $attributeTables) . "</comment>");
104+
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
104105
} catch (\Exception $exception) {
105106
$this->attributeResource->rollBack();
106107

107108
$output->writeln("");
108109
$output->writeln("<error>{$exception->getMessage()}</error>");
110+
// we must have an exit code higher than zero to indicate something was wrong
111+
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
109112
}
110113
}
111114

0 commit comments

Comments
 (0)