Skip to content

Commit aaa981d

Browse files
committed
DOCSP-34891: Add admonition to mention users must catch errors raised by withTransaction() callback (mongodb#922)
(cherry picked from commit dc66c14)
1 parent 5009542 commit aaa981d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

source/fundamentals/transactions.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ if a callback you pass to the ``withTransaction()`` method returns the
170170
document ``{ hello: "world" }``, then the ``withTransaction()`` method
171171
also returns that document.
172172

173+
.. important::
174+
175+
To avoid infinite looping errors, ensure that the callback you pass to
176+
the ``withTransaction()`` method catches any errors that it raises.
177+
173178
When you use the Convenient Transaction API, you
174179
can propagate return values from the callback as the return values of
175180
the ``withTransaction()`` and ``withSession()`` methods to

0 commit comments

Comments
 (0)