Skip to content

Commit e999ed2

Browse files
committed
address review
1 parent 2095013 commit e999ed2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pymongo/asynchronous/client_session.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,8 @@ async def callback(session, custom_arg, custom_kwarg=None):
663663
The ``callback`` MUST NOT silently handle command errors
664664
without allowing such errors to propagate. Command errors may abort the
665665
transaction on the server, and an attempt to commit the transaction will
666-
be rejected with a ``NoSuchTransaction`` error.
666+
be rejected with a ``NoSuchTransaction`` error. For more information see
667+
the `transactions specification`_.
667668
668669
When :meth:`~AsyncClientSession.commit_transaction` raises an exception with
669670
the ``"UnknownTransactionCommitResult"`` error label,
@@ -694,6 +695,9 @@ async def callback(session, custom_arg, custom_kwarg=None):
694695
:return: The return value of the ``callback``.
695696
696697
.. versionadded:: 3.9
698+
699+
.. _tranactions specification:
700+
https://github.com/mongodb/specifications/blob/master/source/transactions-convenient-api/transactions-convenient-api.md#handling-errors-inside-the-callback
697701
"""
698702
start_time = time.monotonic()
699703
while True:

pymongo/synchronous/client_session.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,8 @@ def callback(session, custom_arg, custom_kwarg=None):
662662
The ``callback`` MUST NOT silently handle command errors
663663
without allowing such errors to propagate. Command errors may abort the
664664
transaction on the server, and an attempt to commit the transaction will
665-
be rejected with a ``NoSuchTransaction`` error.
665+
be rejected with a ``NoSuchTransaction`` error. For more information see
666+
the `transactions specification`_.
666667
667668
When :meth:`~ClientSession.commit_transaction` raises an exception with
668669
the ``"UnknownTransactionCommitResult"`` error label,
@@ -693,6 +694,9 @@ def callback(session, custom_arg, custom_kwarg=None):
693694
:return: The return value of the ``callback``.
694695
695696
.. versionadded:: 3.9
697+
698+
.. _tranactions specification:
699+
https://github.com/mongodb/specifications/blob/master/source/transactions-convenient-api/transactions-convenient-api.md#handling-errors-inside-the-callback
696700
"""
697701
start_time = time.monotonic()
698702
while True:

0 commit comments

Comments
 (0)