| Elektra 0.11.0

Functions
error.h File Reference

Elektra error. More...

`#include "types.h"`
`#include <kdb.h>`
`#include <stdbool.h>`

## Functions
ElektraError * | elektraErrorPureWarning (void)
| Creates a dummy ElektraError struct to store warnings in.
const char * | elektraErrorCode (const ElektraError *error)
const char * | elektraErrorDescription (const ElektraError *error)
void | elektraErrorReset (ElektraError **error)
| Frees the memory used by the error and sets the referenced error variable to NULL.
ElektraError * | elektraErrorConversionToString (KDBType sourceType, const char *keyname)
| Creates a "Conversion to string failed" error.
ElektraError * | elektraErrorConversionFromString (KDBType targetType, const char *keyname, const char *sourceValue)
| Creates a "Conversion from string failed" error.

## Detailed Description

Elektra error.

Copyright
  BSD License (see doc/LICENSE.md or http://www.libelektra.org)

## Function Documentation

## ◆ elektraErrorConversionFromString()

ElektraError * elektraErrorConversionFromString | ( | KDBType | targetType,
|  | const char * | keyname,
|  | const char * | sourceValue
| ) |  |

Creates a "Conversion from string failed" error.

Parameters

  targetType | The type into which `sourceValue` couldn't be converted.
  keyname | The name of the key that couldn't be converted.
  sourceValue | The value that couldn't be converted.

Returns
  A newly allocated ElektraError (free with elektraErrorReset()).

## ◆ elektraErrorConversionToString()

ElektraError * elektraErrorConversionToString | ( | KDBType | sourceType,
|  | const char * | keyname
| ) |  |

Creates a "Conversion to string failed" error.

Parameters

  sourceType | The type which failed to be converted to string.
  keyname | The name of the key that couldn't be converted.

Returns
  A newly allocated ElektraError (free with elektraErrorReset()).