Skip to content

Commit 13dc330

Browse files
committed
Catch CommandException before calling getResultDocument()
1 parent 17d87b2 commit 13dc330

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/session/transaction-integration-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ while (true) {
5858

5959
$session->commitTransaction();
6060
echo "Transaction committed.\n";break;
61-
} catch (\MongoDB\Driver\Exception\Exception $e) {
61+
} catch (\MongoDB\Driver\Exception\CommandException $e) {
6262
$rd = $e->getResultDocument();
6363

6464
if (isset($rd->errorLabels) && in_array('TransientTransactionError', $rd->errorLabels)) {

0 commit comments

Comments
 (0)