MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / _resolve_uri

Method _resolve_uri

pymongo/asynchronous/srv_resolver.py:106–117  ·  view source on GitHub ↗
(self, encapsulate_errors: bool)

Source from the content-addressed store, hash-verified

104 return (b"&".join([b"".join(res.strings) for res in results])).decode("utf-8") # type: ignore[attr-defined]
105
106 async def _resolve_uri(self, encapsulate_errors: bool) -> resolver.Answer:
107 try:
108 results = await _resolve(
109 "_" + self.__srv + "._tcp." + self.__fqdn, "SRV", lifetime=self.__connect_timeout
110 )
111 except Exception as exc:
112 if not encapsulate_errors:
113 # Raise the original error.
114 raise
115 # Else, raise all errors as ConfigurationError.
116 raise ConfigurationError(str(exc)) from exc
117 return results
118
119 async def _get_srv_response_and_hosts(
120 self, encapsulate_errors: bool

Callers 1

Calls 2

ConfigurationErrorClass · 0.90
_resolveFunction · 0.70

Tested by

no test coverage detected