Haka: include/haka/error.h File Reference

Haka

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Functions
error.h File Reference
`#include <haka/types.h>`
`#include <haka/compiler.h>`

Go to the source code of this file.

## Functions
void | error (const char *error,...) FORMAT_PRINTF(1
void const char * | errno_error (int err)
bool | check_error (void)
const char * | clear_error (void)

## Detailed Description

Error handling functions.

## Function Documentation

bool check_error | ( | void |  | ) |

Check if an error has occurred. This function does not clear error flag.

const char* clear_error | ( | void |  | ) |

Get the error message and clear the error state.

void const char* errno_error | ( | int | err | ) |

Convert the `err` value to a human readable error message.

The returned string will be erased by the next call to this function. This function is thread-safe.

void error | ( | const char * | error,
|  |  | ...
| ) |  |

Set `error` to be reported to the callers. The function follows the printf API and can be used in multi-threaded application. The error can then be retrieved using clear_error() and check_error().

If lua is at the origin of this call, the error will be converted to a lua error.