|
RichErrors
A C library for rich (nested) error information
|
RichErrors is a small library for supporting error handling in C or C++ software consisting of multiple dynamically loaded modules (DLLs, shared objects, Mach-O bundles, etc.). It uses a pure C interface for maximum ABI compatibility between modules.
Unlike some C libraries for "exception handling", RichErrors does not use setjmp/longjmp to emulate C++-style exceptions. Instead, it extends the concept of an error code return value and allows construction of nested (wrapped) error objects (cf. Java Exception cause, Python __cause__).
Because integer error codes defined by various subsystems can be valuable information, RichErrors allows explicit wrapping of error codes (together with a specific message string). In order to segregate error codes arising from different subsystems or third-party libraries, every error containing an error code must be assigned a pre-registered "domain".
Known limitations and possible future extensions: