Skip to content

Commit

Permalink
Merge pull request #6 from bowphp/add-command-transaction-service
Browse files Browse the repository at this point in the history
Fixes exception type
  • Loading branch information
papac authored Aug 23, 2023
2 parents 93d8bf6 + 7753132 commit 1bd3852
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Command/CommandHandlerTransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Bow\CQRS\Command\CommandInterface;
use Bow\CQRS\Command\CommandHandlerInterface;
use Bow\Database\Database;
use Bow\Database\Exception\DatabaseException;
use Exception;

abstract class CommandHandlerTransactionService implements CommandHandlerInterface
{
Expand All @@ -28,7 +28,7 @@ public function process(CommandInterface $command): mixed
Database::commit();

return $result;
} catch (DatabaseException $e) {
} catch (Exception $e) {
Database::rollback();
throw $e;
}
Expand Down

0 comments on commit 1bd3852

Please sign in to comment.