MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / _create_connection

Function _create_connection

mongoengine/connection.py:381–389  ·  view source on GitHub ↗

Create the new connection for this alias. Raise ConnectionFailure if it can't be established.

(alias, mongo_client_class, **connection_settings)

Source from the content-addressed store, hash-verified

379
380
381def _create_connection(alias, mongo_client_class, **connection_settings):
382 """
383 Create the new connection for this alias. Raise
384 ConnectionFailure if it can't be established.
385 """
386 try:
387 return mongo_client_class(**connection_settings)
388 except Exception as e:
389 raise ConnectionFailure(f"Cannot connect to database {alias} :\n{e}")
390
391
392def _find_existing_connection(connection_settings):

Callers 1

get_connectionFunction · 0.85

Calls 1

ConnectionFailureClass · 0.85

Tested by

no test coverage detected