---
name: "mongoc_client_set_error_api"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_client_set_error_api"
---

# mongoc\_client\_set\_error\_api(3)

## SYNOPSIS

```
bool
mongoc_client_set_error_api (mongoc_client_t *client, int32_t version);
```

Configure how the C Driver reports errors. See *Setting the Error API Version*.

Do not use this function with pooled clients, see *mongoc\_client\_pool\_set\_error\_api()*.

## PARAMETERS

- •

  **client**: A *mongoc\_client\_t*.

- •

  **version**: The version of the error API, either **MONGOC\_ERROR\_API\_VERSION\_LEGACY** or **MONGOC\_ERROR\_API\_VERSION\_2**.

## RETURNS

Returns true on success. If any arguments are invalid, returns false and logs an error.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
