diff --git a/src/Command/MigrateCommand.php b/src/Command/MigrateCommand.php index 426645e8..abc73655 100644 --- a/src/Command/MigrateCommand.php +++ b/src/Command/MigrateCommand.php @@ -19,7 +19,6 @@ use Cake\Console\ConsoleOptionParser; use Cake\Event\EventDispatcherTrait; use DateTime; -use Exception; use LogicException; use Migrations\Config\ConfigInterface; use Migrations\Migration\ManagerFactory; @@ -170,11 +169,6 @@ protected function executeMigrations(Arguments $args, ConsoleIo $io): ?int $manager->migrate($version, $fake, $count); } $end = microtime(true); - } catch (Exception $e) { - $io->err('' . $e->getMessage() . ''); - $io->verbose($e->getTraceAsString()); - - return self::CODE_ERROR; } catch (Throwable $e) { $io->err('' . $e->getMessage() . ''); $io->verbose($e->getTraceAsString()); diff --git a/src/Command/RollbackCommand.php b/src/Command/RollbackCommand.php index de33c27a..d3647f54 100644 --- a/src/Command/RollbackCommand.php +++ b/src/Command/RollbackCommand.php @@ -19,7 +19,6 @@ use Cake\Console\ConsoleOptionParser; use Cake\Event\EventDispatcherTrait; use DateTime; -use Exception; use InvalidArgumentException; use LogicException; use Migrations\Config\ConfigInterface; @@ -183,11 +182,6 @@ protected function executeMigrations(Arguments $args, ConsoleIo $io): ?int $manager->rollback($target, $force, $targetMustMatch, $fake); } $end = microtime(true); - } catch (Exception $e) { - $io->err('' . $e->getMessage() . ''); - $io->verbose($e->getTraceAsString()); - - return self::CODE_ERROR; } catch (Throwable $e) { $io->err('' . $e->getMessage() . ''); $io->verbose($e->getTraceAsString()); diff --git a/src/Command/SeedCommand.php b/src/Command/SeedCommand.php index b7562809..02726ae7 100644 --- a/src/Command/SeedCommand.php +++ b/src/Command/SeedCommand.php @@ -18,10 +18,10 @@ use Cake\Console\ConsoleIo; use Cake\Console\ConsoleOptionParser; use Cake\Event\EventDispatcherTrait; -use Exception; use Migrations\Config\ConfigInterface; use Migrations\Migration\ManagerFactory; use Migrations\Util\Util; +use Throwable; /** * Seed command runs seeder scripts @@ -166,8 +166,9 @@ protected function executeSeeds(Arguments $args, ConsoleIo $io): ?int // Get all available seeds and ask for confirmation try { $availableSeeds = $manager->getSeeds(); - } catch (Exception $e) { - $io->error('Failed to load seeds: ' . $e->getMessage()); + } catch (Throwable $e) { + $io->err('Failed to load seeds: ' . $e->getMessage() . ''); + $io->verbose($e->getTraceAsString()); return static::CODE_ERROR; }