Elektra  0.8.26
Functions
elektra_error.c File Reference

Elektra error codes. More...

#include "elektra/conversion.h"
#include "elektra/error.h"
#include "kdberrors.h"
#include "kdbhelper.h"
#include "kdbprivate.h"
#include <string.h>
Include dependency graph for elektra_error.c:

Functions

ElektraError * elektraErrorCreate (ElektraErrorCode code, const char *description, ElektraErrorSeverity severity)
 Creates a new ElektraError using the provided values. More...
 
ElektraErrorCode elektraErrorCode (const ElektraError *error)
 
const char * elektraErrorDescription (const ElektraError *error)
 
ElektraErrorSeverity elektraErrorSeverity (const ElektraError *error)
 
int elektraKDBErrorCode (const ElektraError *error)
 
const char * elektraKDBErrorDescription (const ElektraError *error)
 
ElektraErrorSeverity elektraKDBErrorSeverity (const ElektraError *error)
 
ElektraKDBErrorGroup elektraKDBErrorGroup (const ElektraError *error)
 
ElektraKDBErrorModule elektraKDBErrorModule (const ElektraError *error)
 
const char * elektraKDBErrorReason (const ElektraError *error)
 
int elektraKDBErrorWarningCount (const ElektraError *error)
 
ElektraError * elektraKDBErrorGetWarning (const ElektraError *error, int index)
 
Key * elektraKDBErrorKey (const ElektraError *error)
 
void elektraErrorReset (ElektraError **error)
 Frees the memory used by the error and sets the referenced error variable to NULL.
 

Detailed Description

Elektra error codes.

Function Documentation

◆ elektraErrorCreate()

ElektraError* elektraErrorCreate ( ElektraErrorCode  code,
const char *  description,
ElektraErrorSeverity  severity 
)

Creates a new ElektraError using the provided values.

The returned value will be allocated with elektraCalloc().

Parameters
codeThe error code of the error.
descriptionThe description of the error.
severityThe severity of the error. Only use ELEKTRA_ERROR_SEVERITY_FATAL, if the error will be raised with elektraFatalError().
groupThe group to which this error belongs.
moduleThe module from which this error originates.
Returns
A newly allocated ElektraError (free with elektraFree()).