Removed unnecessary catched exceptions in commands (#421)

* Remove catch exception

Because this is broken -vvv and don't show stack trace

* Update DatabaseDropCommand.php

* Update FixturesDumpCommand.php

* Update TableDropCommand.php
This commit is contained in:
Maxim 2016-05-27 23:07:47 +10:00 committed by Marc J. Schmidt
commit cdcb3f6b9f
4 changed files with 36 additions and 69 deletions

View file

@ -54,27 +54,19 @@ class DatabaseCreateCommand extends AbstractCommand
$query = 'CREATE DATABASE '. $dbName .';';
}
try {
$manager = new ConnectionManagerSingle();
$manager->setConfiguration($this->getTemporaryConfiguration($config));
$manager = new ConnectionManagerSingle();
$manager->setConfiguration($this->getTemporaryConfiguration($config));
$serviceContainer = Propel::getServiceContainer();
$serviceContainer->setAdapterClass($connectionName, $config['adapter']);
$serviceContainer->setConnectionManager($connectionName, $manager);
$serviceContainer = Propel::getServiceContainer();
$serviceContainer->setAdapterClass($connectionName, $config['adapter']);
$serviceContainer->setConnectionManager($connectionName, $manager);
$connection = Propel::getConnection($connectionName);
$connection = Propel::getConnection($connectionName);
$statement = $connection->prepare($query);
$statement->execute();
$statement = $connection->prepare($query);
$statement->execute();
$output->writeln(sprintf('<info>Database <comment>%s</comment> has been created.</info>', $dbName));
} catch (\Exception $e) {
$this->writeSection($output, array(
'[Propel] Exception caught',
'',
$e->getMessage()
), 'fg=white;bg=red');
}
$output->writeln(sprintf('<info>Database <comment>%s</comment> has been created.</info>', $dbName));
}
/**