---
name: "abz_set_error"
section: "3abz"
platform: "linux"
package: "libabz0-dev"
version: "0.5.1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/abz_set_error"
---

# abz\_set\_error(3abz)

error functions

## NAME

abz\_set\_error, abz\_cat\_error, abz\_clear\_error - error functions

## LIBRARIES

Abz Library (-labz), Debug Library (-ldebug)

## SYNOPSIS

```
#include <abz/error.h>

void abz_set_error(const char *fmt, ...);
void abz_cat_error(const char *fmt, ...);
void abz_clear_error();
const char *abz_get_error();
```

## DESCRIPTION

The functions in the error family can be used to store error messages. Error messages are set using **abz\_set\_error()**. Once set, an error message can not be overwritten. Call **abz\_clear\_error()** to clear the error message and **abz\_get\_error()** to retrieve the last set error message. If no error message is set, **abz\_get\_error()** returns an empty string.

It is possible to append error messages to the last set error message by calling **abz\_cat\_error()**. If an error already exist, a newline will be inserted between the two error messages. The usual rule of set-once-clear does not apply here (i.e. if you call this consecutive times, the error message will span multiple lines).

## NOTES

None of the libabz routines are thread-safe. I'm not planning to change this either! For more information, please see http://threading.2038bug.com/

## AUTHOR

Written by Abraham vd Merwe \<abz@blio.com\>
