From f7a6f0a4460cbe33fdf8459423b0618e19e2fdf6 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Wed, 30 Jan 2019 22:05:04 +0300 Subject: [PATCH] Update Transaction.php --- source/Spiral/ORM/Transaction.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/Spiral/ORM/Transaction.php b/source/Spiral/ORM/Transaction.php index c074df5..64e46e1 100644 --- a/source/Spiral/ORM/Transaction.php +++ b/source/Spiral/ORM/Transaction.php @@ -127,9 +127,13 @@ public function run(bool $forceTransaction = false, bool $clean = true) $executedCommands[] = $command; } } catch (\Throwable $e) { - foreach (array_reverse($wrappedDrivers) as $driver) { - /** @var Driver $driver */ - $driver->rollbackTransaction(); + try { + foreach (array_reverse($wrappedDrivers) as $driver) { + /** @var Driver $driver */ + $driver->rollbackTransaction(); + } + } catch (\Throwable $et) { + throw $e; } foreach (array_reverse($executedCommands) as $command) {