MONGOC_CLIENT_..._SET_ERROR_API(3)

πŸ’… MONGOC_CLIENT_..._SET_ERROR_API(3) πŸ’…

okay so bestie, this is a libmongoc page, and the star of the show is mongoc_client_pool_set_error_api β€” the function that tells the C Driver how it should be reporting errors 🫢


✨ SYNOPSIS ✨

bool
mongoc_client_pool_set_error_api (mongoc_client_pool_t *client,
                                  int32_t version);

This is your one-stop setup call for configuring how the C Driver reports errors πŸ’– (peep Setting the Error API Version for the full lore on that).


πŸŽ€ PARAMETERS πŸŽ€

  • pool β€” a mongoc_client_pool_t. (yes, the synopsis calls it client, the parameter list calls it pool β€” same energy, it's the pool, we move πŸ’…)
  • version β€” the version of the error API you want, and it's gotta be either MONGOC_ERROR_API_VERSION_LEGACY or MONGOC_ERROR_API_VERSION_2. those are the only two options, no cap πŸ¦‹

🌸 RETURNS 🌸

Returns true if the error API version was set successfully 😌✨ β€” but if version is invalid, it logs an error message and returns false. so like, invalid input = sad boi hours, check your return value fr fr πŸ’€


πŸ¦‹ THREAD SAFETY πŸ¦‹

ngl this is the important one, so listen up:

This function can only be called once on a pool, and it must be called before the first call to mongoc_client_pool_pop().

like, once. one time only. and before you pop a client, periodt πŸ‘‘β°


πŸ’œ AUTHOR πŸ’œ

MongoDB, Inc β€” icons only πŸŽ€

2009-present, MongoDB, Inc. πŸ’–


and that's the whole vibe check bestie πŸ’… mwah 😘 β€” this page was served up by libmongoc 2.5.6, dated Oct 09, 202, see you in the next man page πŸ¦‹βœ¨πŸŒΈ

πŸ“¦ where this page comes from