Definition in file error.h.
#include <nobug.h>
#include <stdlib.h>


Go to the source code of this file.
Defines | |
| #define | LUMIERA_DIE(err) do { NOBUG_ERROR(NOBUG_ON, "Fatal Error: %s ", strchr(LUMIERA_ERROR_##err, ':')); abort(); } while(0) |
| Abort unconditionally with a 'Fatal Error!' message. | |
| #define | LUMIERA_ERROR_DECLARE(err) extern lumiera_err LUMIERA_ERROR_##err |
| Forward declare an error constant. | |
| #define | LUMIERA_ERROR_DEFINE(err, msg) lumiera_err LUMIERA_ERROR_##err = "LUMIERA_ERROR_" #err ":" msg |
| Definition and initialization of an error constant. | |
| #define | LUMIERA_ERROR_SET(flag, err) |
| Helper macro to raise an error for the current thread. | |
Typedefs | |
| typedef const char * | lumiera_err |
Functions | |
| lumiera_err | lumiera_error (void) |
| Get and clear current error state. | |
| LUMIERA_ERROR_DECLARE (ERRNO) | |
| lumiera_err | lumiera_error_peek (void) |
| Check current error state without clearing it Please avoid this function and use lumiera_error() if possible. | |
| lumiera_err | lumiera_error_set (lumiera_err err) |
| Set error state for the current thread. | |
| #define LUMIERA_DIE | ( | err | ) | do { NOBUG_ERROR(NOBUG_ON, "Fatal Error: %s ", strchr(LUMIERA_ERROR_##err, ':')); abort(); } while(0) |
Abort unconditionally with a 'Fatal Error!' message.
This macro is used whenever the program end up in a invalid state from which no runtime recovery is possible
Definition at line 44 of file error.h.
Referenced by lumiera_calloc(), lumiera_condition_destroy(), lumiera_filedescriptor_registry_init(), lumiera_interfaceregistry_init(), lumiera_malloc(), lumiera_mutex_destroy(), lumiera_plugin_discover(), lumiera_realloc(), lumiera_reccondition_destroy(), lumiera_rwlock_destroy(), and lumiera_strndup().
| #define LUMIERA_ERROR_DECLARE | ( | err | ) | extern lumiera_err LUMIERA_ERROR_##err |
| #define LUMIERA_ERROR_DEFINE | ( | err, | |||
| msg | ) | lumiera_err LUMIERA_ERROR_##err = "LUMIERA_ERROR_" #err ":" msg |
Definition and initialization of an error constant.
This macro eases the error definition in implementation files
| err | name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY) | |
| msg | message describing the error in plain english (example: "memory allocation failed") |
| #define LUMIERA_ERROR_SET | ( | flag, | |||
| err | ) |
Value:
(({ERROR (flag, "%s", strchr(LUMIERA_ERROR_##err, ':')+1);}), \
lumiera_error_set(LUMIERA_ERROR_##err))
This macro eases setting an error. It adds NoBug logging support to the low level error handling.
| flag | NoBug flag describing the subsystem where the error was raised | |
| err | name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY) |
Definition at line 70 of file error.h.
Referenced by lumiera_config_number_get(), lumiera_config_wordlist_get(), lumiera_file_mmapings(), lumiera_filedescriptor_acquire(), lumiera_filehandlecache_handle_acquire(), lumiera_mmap_init(), lumiera_plugin_register(), and scan_string().
| lumiera_err lumiera_error_set | ( | lumiera_err | err | ) |
Set error state for the current thread.
If the error state of the current thread was cleared, then set it, else preserve the old state.
| nerr | name of the error with 'LUMIERA_ERROR_' prefix (example: LUMIERA_ERROR_NO_MEMORY) |
Definition at line 50 of file error.c.
Referenced by lumiera::Error::Error().

| lumiera_err lumiera_error | ( | void | ) |
Get and clear current error state.
This function clears the error state, if it needs to be reused, one has to store it in a temporary variable.
Definition at line 64 of file error.c.
Referenced by test::Suite::describe(), and lumiera_plugin_init().

| lumiera_err lumiera_error_peek | ( | void | ) |
Check current error state without clearing it Please avoid this function and use lumiera_error() if possible.
Errors must be cleared else certain parts of the application refuse to cooperate with you. This shall only be used to decide if one wants to barf out of a loop or subroutine to deliver the error to a higher level.
Definition at line 77 of file error.c.
Referenced by lumiera_plugin_discover(), and lumiera_plugin_register().

1.5.6