From 2c48f2bf5bb5229af0bc31a17379ab5d351e95e8 Mon Sep 17 00:00:00 2001 From: Rick in t Veld Date: Thu, 22 Aug 2024 15:16:50 +0200 Subject: [PATCH] remove the catch blocks from the commands --- src/Command/AccountCommand.php | 10 +++------- src/Command/DailyDataCommand.php | 9 ++------- src/Command/DailyGainCommand.php | 10 +++------- src/Command/HistoryCommand.php | 10 +++------- 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/src/Command/AccountCommand.php b/src/Command/AccountCommand.php index 8302613..b828654 100644 --- a/src/Command/AccountCommand.php +++ b/src/Command/AccountCommand.php @@ -33,13 +33,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $aggregator = new AggregateRoot(); - try { - ($this->accountActionHandler)($aggregator); - $this->accountTable->setRows($aggregator->getAccounts())->render($output); - } catch (\Throwable $e) { - $io->error($e->getMessage()); - return Command::FAILURE; - } + ($this->accountActionHandler)($aggregator); + + $this->accountTable->setRows($aggregator->getAccounts())->render($output); return Command::SUCCESS; } diff --git a/src/Command/DailyDataCommand.php b/src/Command/DailyDataCommand.php index 52b011b..512c271 100644 --- a/src/Command/DailyDataCommand.php +++ b/src/Command/DailyDataCommand.php @@ -31,14 +31,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $aggregator = new DailyDataAggregator(); - try { - ($this->dailyDataActionHandler)($aggregator); - $this->dailyDataTable->setRows($aggregator->getData())->render($output); - } catch (\Throwable $e) { - $io->error($e->getMessage()); - return Command::FAILURE; - } + ($this->dailyDataActionHandler)($aggregator); + $this->dailyDataTable->setRows($aggregator->getData())->render($output); return Command::SUCCESS; } diff --git a/src/Command/DailyGainCommand.php b/src/Command/DailyGainCommand.php index e24b5e8..fb5f353 100644 --- a/src/Command/DailyGainCommand.php +++ b/src/Command/DailyGainCommand.php @@ -33,13 +33,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $aggregator = new DailyGainsAggregator(); - try { - ($this->dailyGainActionHandler)($aggregator); - $this->dailyGainTable->setRows($aggregator->getData())->render($output); - } catch (\Throwable $e) { - $io->error($e->getMessage()); - return Command::FAILURE; - } + ($this->dailyGainActionHandler)($aggregator); + + $this->dailyGainTable->setRows($aggregator->getData())->render($output); return Command::SUCCESS; } diff --git a/src/Command/HistoryCommand.php b/src/Command/HistoryCommand.php index f67b9cf..03a9133 100644 --- a/src/Command/HistoryCommand.php +++ b/src/Command/HistoryCommand.php @@ -34,13 +34,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $aggregator = new HistoryAggregator(); - try { - ($this->historyActionHandler)($aggregator); - $this->historyTable->setRows($aggregator->getData())->render($output); - } catch (\Exception $e) { - $io->error($e->getMessage()); - return Command::FAILURE; - } + ($this->historyActionHandler)($aggregator); + + $this->historyTable->setRows($aggregator->getData())->render($output); return Command::SUCCESS; }