Skip to content

Commit ada4d4e

Browse files
committed
add Throwable in Connection::transaction()
1 parent d1e4da8 commit ada4d4e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Connection.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,10 @@ public function transaction(callable $actions, $transactionOptions = [], $sessio
568568
if($newClientSession->getTransaction()->getIsActive())
569569
$newClientSession->getTransaction()->rollBack();
570570
throw $e;
571+
} catch (\Throwable $e) {
572+
if($newClientSession->getTransaction()->getIsActive())
573+
$newClientSession->getTransaction()->rollBack();
574+
throw $e;
571575
}
572576
}
573-
}
577+
}

0 commit comments

Comments
 (0)