## GwyErrorList

GwyErrorList — List of GErrors

## Functions

void | gwy_error_list_add ()
void | gwy_error_list_propagate ()
void | gwy_error_list_clear ()

## Types and Values

typedef | GwyErrorList

## Includes

    #include <libgwyddion/gwyddion.h>

## Description

GwyErrorList is a plain GSList containing pointers to GErrors as the `data` members. You can use all GSList functions on GwyErrorList, a few additional functions are provided for convenient error list handling Notice the calling convention differs from the usual GSList functions and resembles more GError functions.

Errors are added to the list with `gwy_error_list_add()` in a stack-like fashion, i.e. the most recent error is the first item in the list.

There is no function to create a GwyErrorList because `NULL` represents an empty list. All items in the list hold some error, there are never any items with `NULL` data members.

To clear all errors in the list and destroy the list, call `gwy_error_list_clear()`.

## Functions

### gwy_error_list_add()

    void
    gwy_error_list_add (GwyErrorList **list,
                        GQuark domain,
                        gint code,
                        const gchar *format,
                        ...);

Adds a newly created error to an error list.

Does nothing if `list` is `NULL`. See also `g_set_error()`.

#### Parameters

list | Pointer to error list or `NULL`. | [nullable]
domain | Error domain. |
code | Error code. |
format | Error message `printf()`-style format. |
... | arguments for `format` . |

### gwy_error_list_propagate()

    void
    gwy_error_list_propagate (GwyErrorList **list,
                              GError *error);

Moves an error to an error list.

The function does nothing if `error` is `NULL`, frees `error` if `list` is `NULL`. Otherwise, it moves the error from `error` to `list` , freeing `error` . See also `g_propagate_error()`.

#### Parameters

list | Pointer to error list or `NULL`. | [nullable]
error | Error to move to `list` . |

### gwy_error_list_clear()

    void
    gwy_error_list_clear (GwyErrorList **list);

Clears all errors in an error list and destroys the list.

If `list` is not `NULL`, it is reset to an empty list, i.e. all errors are cleared and `NULL` is assigned to the location it points to.

#### Parameters

list | Pointer to error list or `NULL`. | [nullable]

## Types and Values

### GwyErrorList

    typedef GSList GwyErrorList;

Representation of an error list.

This is an alias of GSList.