diff --git a/php_phongo.c b/php_phongo.c index d35068629..0e3062623 100644 --- a/php_phongo.c +++ b/php_phongo.c @@ -3432,13 +3432,14 @@ void phongo_manager_init(php_phongo_manager_t* manager, const char* uri_string, #endif manager->client = php_phongo_make_mongo_client(uri, driverOptions); - mongoc_client_set_error_api(manager->client, MONGOC_ERROR_API_VERSION_2); if (!manager->client) { phongo_throw_exception(PHONGO_ERROR_RUNTIME, "Failed to create Manager from URI: '%s'", uri_string); goto cleanup; } + mongoc_client_set_error_api(manager->client, MONGOC_ERROR_API_VERSION_2); + #ifdef MONGOC_ENABLE_SSL if (ssl_opt) { mongoc_client_set_ssl_opts(manager->client, ssl_opt);