---
name: "mongoc_error_has_label"
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_error_has_label"
---

# mongoc\_error\_has\_label(3)

## SYNOPSIS

```
bool
mongoc_error_has_label (const bson_t *reply, const char *label);
```

Test whether a reply from a failed operation includes a specific error label. See *Error Labels* for details, and see *mongoc\_client\_session\_start\_transaction()* for example code that demonstrates their use.

## PARAMETERS

- •

  **reply**: A non-**NULL** pointer to *overwritable storage* for a *bson\_t* to contain the results.

- •

  **label**: The label to test for, such as "TransientTransactionError" or "UnknownTransactionCommitResult".

## RETURNS

Returns true if **reply** contains the error label.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
