Skip to content

Commit 8d84b18

Browse files
warren's requested changes
1 parent 974f01c commit 8d84b18

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sessions.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,9 @@ async function endTransaction(
767767
);
768768
await partiallyHandleFirstCommandAttempt();
769769
commandHandler();
770-
} catch (err) {
770+
} catch (firstAttemptErr) {
771771
await partiallyHandleFirstCommandAttempt();
772-
if (err instanceof MongoError && isRetryableWriteError(err)) {
772+
if (firstAttemptErr instanceof MongoError && isRetryableWriteError(firstAttemptErr)) {
773773
// SPEC-1185: apply majority write concern when retrying commitTransaction
774774
if (command.commitTransaction) {
775775
// per txns spec, must unpin session in this case
@@ -790,11 +790,11 @@ async function endTransaction(
790790
})
791791
);
792792
commandHandler();
793-
} catch (err2) {
794-
commandHandler(err2);
793+
} catch (secondAttemptErr) {
794+
commandHandler(secondAttemptErr);
795795
}
796796
} else {
797-
commandHandler(err);
797+
commandHandler(firstAttemptErr);
798798
}
799799
}
800800
}

0 commit comments

Comments
 (0)