> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_error.md).

# mariadb\_rpl\_error()

Returns the error message for the most recent Binlog API function call that can succeed or fail.

### Syntax

```sql
#include <mariadb_rpl.h>

const char *mariadb_rpl_error(MARIADB_RPL *rpl);
```

### Parameters

| Parameter | Description                                                                                                                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rpl`     | A replication handle previously allocated by [`mariadb_rpl_init()`](/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_init.md). |

### Returns

Returns a null-terminated string containing the error message on failure, or an empty string (`""`) if no error has occurred.

### Notes

Client error codes are defined in `errmsg.h`. Server error codes are defined in `mysqld_error.h` in the MariaDB server source distribution.

### History

Added in MariaDB Connector/C 3.3.5.

### See also

[`mariadb_rpl_errno()`](/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_errno.md)

<sub>*This page is: Copyright © 2026 MariaDB. All rights reserved.*</sub>
