#include <avis/errors.h>
Functions in the library that may fail will use a pointer to an ElvinError instance to indicate, via an error code and message, if the function or any sub function fails. As a convenience, functions which would otherwise return void will often return true/false to indicate error status.
Note that the Elvin struct used for client connections contains an embedded error context that takes the place of an explicit error context parameter.
Example:
ElvinError error = ELVIN_EMPTY_ERROR;
function_that_may_fail (arg1, arg2, ..., &error);
if (elvin_error_occurred (&error)) elvin_perror ("error", &error);
elvin_error_free (&error);
Data Fields | |
int | code |
char * | message |
int ElvinError::code |
char* ElvinError::message |