diff --git a/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php
index 44cdd5688..7c33174f5 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php
@@ -65,12 +65,21 @@ EOT
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
- $em->getConfiguration()->ensureProductionSettings();
- if ($input->getOption('complete') !== null) {
- $em->getConnection()->connect();
+ $error = false;
+ try {
+ $em->getConfiguration()->ensureProductionSettings();
+
+ if ($input->getOption('complete') !== null) {
+ $em->getConnection()->connect();
+ }
+ } catch (\Exception $e) {
+ $error = true;
+ $output->writeln('' . $e->getMessage() . '');
}
- $output->write('Environment is correctly configured for production.');
+ if ($error === false) {
+ $output->write('Environment is correctly configured for production.' . PHP_EOL);
+ }
}
}
\ No newline at end of file