Skip to content

Commit e2c745f

Browse files
committed
get whole traceback
1 parent 9029d23 commit e2c745f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pymongo/asynchronous/srv_resolver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ async def _resolve_uri(self, encapsulate_errors: bool) -> resolver.Answer:
122122
# Raise the original error.
123123
raise
124124
# Else, raise all errors as ConfigurationError.
125-
raise ConfigurationError(str(exc)) from exc
125+
import traceback
126+
127+
raise ConfigurationError(traceback.format_exception(exc)) from exc
126128
return results
127129

128130
async def _get_srv_response_and_hosts(

pymongo/synchronous/srv_resolver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def _resolve_uri(self, encapsulate_errors: bool) -> resolver.Answer:
122122
# Raise the original error.
123123
raise
124124
# Else, raise all errors as ConfigurationError.
125-
raise ConfigurationError(str(exc)) from exc
125+
import traceback
126+
127+
raise ConfigurationError(traceback.format_exception(exc)) from exc
126128
return results
127129

128130
def _get_srv_response_and_hosts(

0 commit comments

Comments
 (0)