Create the new connection for this alias. Raise ConnectionFailure if it can't be established.
(alias, mongo_client_class, **connection_settings)
| 379 | |
| 380 | |
| 381 | def _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 | |
| 392 | def _find_existing_connection(connection_settings): |
no test coverage detected