Skip to content

Commit 7d4495d

Browse files
committed
testing
1 parent 92eafbf commit 7d4495d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pymongo/asynchronous/mongo_client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
import contextlib
3636
import os
37+
import traceback
3738
import warnings
3839
import weakref
3940
from collections import defaultdict
@@ -2580,7 +2581,7 @@ async def run(self) -> T:
25802581
# be a persistent outage. Attempting to retry in this case will
25812582
# most likely be a waste of time.
25822583
if self._operation in (_Op.LIST_COLLECTIONS, _Op.INSERT):
2583-
print(f"Raising timeout error for {self._operation}")
2584+
print(f"Raising error for {self._operation} at {traceback.print_stack(limit=1)}")
25842585
raise
25852586
except PyMongoError as exc:
25862587
if self._operation in (_Op.LIST_COLLECTIONS, _Op.INSERT):
@@ -2595,20 +2596,20 @@ async def run(self) -> T:
25952596
and exc_code not in helpers_shared._RETRYABLE_ERROR_CODES
25962597
):
25972598
if self._operation in (_Op.LIST_COLLECTIONS, _Op.INSERT):
2598-
print(f"Raising error for {self._operation}")
2599+
print(f"Raising error for {self._operation} at {traceback.print_stack(limit=1)}")
25992600
raise
26002601
self._retrying = True
26012602
self._last_error = exc
26022603
else:
26032604
if self._operation in (_Op.LIST_COLLECTIONS, _Op.INSERT):
2604-
print(f"Raising error for {self._operation}")
2605+
print(f"Raising error for {self._operation} at {traceback.print_stack(limit=1)}")
26052606
raise
26062607

26072608
# Specialized catch on write operation
26082609
if not self._is_read:
26092610
if not self._retryable:
26102611
if self._operation in (_Op.LIST_COLLECTIONS, _Op.INSERT):
2611-
print(f"Raising error for {self._operation}")
2612+
print(f"Raising error for {self._operation} at {traceback.print_stack(limit=1)}")
26122613
raise
26132614
if isinstance(exc, ClientBulkWriteException) and exc.error:
26142615
retryable_write_error_exc = isinstance(
@@ -2622,11 +2623,11 @@ async def run(self) -> T:
26222623
if not retryable_write_error_exc or self._is_not_eligible_for_retry():
26232624
if exc.has_error_label("NoWritesPerformed") and self._last_error:
26242625
if self._operation in (_Op.LIST_COLLECTIONS, _Op.INSERT):
2625-
print(f"Raising error for {self._operation}")
2626+
print(f"Raising error for {self._operation} at {traceback.print_stack(limit=1)}")
26262627
raise self._last_error from exc
26272628
else:
26282629
if self._operation in (_Op.LIST_COLLECTIONS, _Op.INSERT):
2629-
print(f"Raising error for {self._operation}")
2630+
print(f"Raising error for {self._operation} at {traceback.print_stack(limit=1)}")
26302631
raise
26312632
if self._bulk:
26322633
self._bulk.retrying = True

0 commit comments

Comments
 (0)