## Error Error — Error reporting facilities. |

## Synopsis

    #include <mirage-error.h>

    enum                MirageErrorCodes;
    GQuark              mirage_error_quark                  (void);

## Description

libMirage uses GLib's GError system for reporting errors. Many functions provided by libMirage's objects take an optional `error` parameter. If `error` is not `NULL`, in case that such function should fail, a GError error is set into it using `g_set_error()`. Unless coming from underlying GLib's systems, the returned error code is one of MirageErrorCodes.

## Details

### enum MirageErrorCodes

    typedef enum {
        MIRAGE_ERROR_LIBRARY_ERROR,
        MIRAGE_ERROR_PARSER_ERROR,
        MIRAGE_ERROR_FRAGMENT_ERROR,
        MIRAGE_ERROR_DISC_ERROR,
        MIRAGE_ERROR_LANGUAGE_ERROR,
        MIRAGE_ERROR_SECTOR_ERROR,
        MIRAGE_ERROR_SESSION_ERROR,
        MIRAGE_ERROR_TRACK_ERROR,
        MIRAGE_ERROR_STREAM_ERROR,
        MIRAGE_ERROR_IMAGE_FILE_ERROR,
        MIRAGE_ERROR_DATA_FILE_ERROR,
        MIRAGE_ERROR_CANNOT_HANDLE,
        MIRAGE_ERROR_ENCRYPTED_IMAGE,
    } MirageErrorCodes;

Error codes for libMirage library.

`MIRAGE_ERROR_LIBRARY_ERROR` | error in core libMirage code
`MIRAGE_ERROR_PARSER_ERROR` | error in parser code
`MIRAGE_ERROR_FRAGMENT_ERROR` | error in fragment code
`MIRAGE_ERROR_DISC_ERROR` | error in disc code
`MIRAGE_ERROR_LANGUAGE_ERROR` | error in language/CD-TEXT code
`MIRAGE_ERROR_SECTOR_ERROR` | error in sector code
`MIRAGE_ERROR_SESSION_ERROR` | error in session code
`MIRAGE_ERROR_TRACK_ERROR` | error in track code
`MIRAGE_ERROR_STREAM_ERROR` | error in stream code
`MIRAGE_ERROR_IMAGE_FILE_ERROR` | error related to image file
`MIRAGE_ERROR_DATA_FILE_ERROR` | error related to data file
`MIRAGE_ERROR_CANNOT_HANDLE` | parser/fragment/file filter cannot handle given file
`MIRAGE_ERROR_ENCRYPTED_IMAGE` | image is encrypted and password needs to be provided

### mirage_error_quark ()

    GQuark              mirage_error_quark                  (void);

Registers an error quark for libMirage if necessary.

Returns : | The error quark used for libMirage errors.