Error handling functions

Error handling functions — Methods to manage the operation errors in GDigicam.

Synopsis

#define             G_DIGICAM_ERROR
enum                GDigicamError;
GQuark              g_digicam_error_quark               (void);
GError*             g_digicam_error_new                 (GDigicamError error_id,
                                                         const gchar *str,
                                                         ...);
void                g_digicam_set_error                 (GError **orig_error,
                                                         GDigicamError error_id,
                                                         const gchar *str,
                                                         ...);

Description

These tools bring together all the needed to handle the GDigicamError codes in order to identify and notify the possible operation errors.

Details

G_DIGICAM_ERROR

#define G_DIGICAM_ERROR g_digicam_error_quark ()

GQuark identifier for GDigicamError.

Returns : the GDigicamError GQuark.

enum GDigicamError

    typedef enum {                             /*< skip >*/
        G_DIGICAM_ERROR_FAILED = 0,
        G_DIGICAM_ERROR_GSTREAMER_BIN_NOT_SET,
        G_DIGICAM_ERROR_VIEWFINDER_NOT_SUPPORTED,
        G_DIGICAM_ERROR_MODE_NOT_SUPPORTED,
        G_DIGICAM_ERROR_INVALID_MODE,
        G_DIGICAM_ERROR_FLASHMODE_NOT_SUPPORTED,
        G_DIGICAM_ERROR_FOCUSMODE_NOT_SUPPORTED,
        G_DIGICAM_ERROR_INVALID_FOCUSMODE,
        G_DIGICAM_ERROR_AUTOFOCUS_LOCKED,
        G_DIGICAM_ERROR_EXPOSUREMODE_NOT_SUPPORTED,
        G_DIGICAM_ERROR_ISOSENSITIVITYMODE_NOT_SUPPORTED,
        G_DIGICAM_ERROR_WHITEBALANCEMODE_NOT_SUPPORTED,
        G_DIGICAM_ERROR_METERINGMODE_NOT_SUPPORTED,
        G_DIGICAM_ERROR_ASPECTRATIO_NOT_SUPPORTED,
        G_DIGICAM_ERROR_QUALITY_NOT_SUPPORTED,
        G_DIGICAM_ERROR_RESOLUTION_NOT_SUPPORTED,
        G_DIGICAM_ERROR_LOCK_NOT_POSSIBLE,
        G_DIGICAM_ERROR_ZOOM_NOT_SUPPORTED,
        G_DIGICAM_ERROR_ZOOM_OUT_OF_RANGE,
        G_DIGICAM_ERROR_AUDIO_NOT_SUPPORTED,
        G_DIGICAM_ERROR_PREVIEW_NOT_SUPPORTED,
    } GDigicamError;

Indicates the type of GError.

G_DIGICAM_ERROR_FAILED Something didn't work, don't know why, probably unrecoverable so there's no point having a more specific errno.
G_DIGICAM_ERROR_GSTREAMER_BIN_NOT_SET There isn't any GStreamer Digicam bin set.
G_DIGICAM_ERROR_VIEWFINDER_NOT_SUPPORTED The GStreamer Digicam has not viewfinder capability.
G_DIGICAM_ERROR_MODE_NOT_SUPPORTED The mode is not supported by the device.
G_DIGICAM_ERROR_INVALID_MODE The operation is invalid for this mode.
G_DIGICAM_ERROR_FLASHMODE_NOT_SUPPORTED The GStreamer Digicam has not this flash mode capability.
G_DIGICAM_ERROR_FOCUSMODE_NOT_SUPPORTED The GStreamer Digicam has not this focus mode capability.
G_DIGICAM_ERROR_INVALID_FOCUSMODE The operation is invalid for this focus mode.
G_DIGICAM_ERROR_AUTOFOCUS_LOCKED The GStreamer Digicam has the autofocus locked.
G_DIGICAM_ERROR_EXPOSUREMODE_NOT_SUPPORTED The GStreamer Digicam has not this exposure mode capability.
G_DIGICAM_ERROR_ISOSENSITIVITYMODE_NOT_SUPPORTED The GStreamer Digicam has not this iso sensitivity mode capability.
G_DIGICAM_ERROR_WHITEBALANCEMODE_NOT_SUPPORTED The GStreamer Digicam has not this white balance mode capability.
G_DIGICAM_ERROR_METERINGMODE_NOT_SUPPORTED The GStreamer Digicam has not this metering mode capability.
G_DIGICAM_ERROR_ASPECTRATIO_NOT_SUPPORTED The GStreamer Digicam has not this aspect ratio capability.
G_DIGICAM_ERROR_QUALITY_NOT_SUPPORTED These quality setting was impossible to perform.
G_DIGICAM_ERROR_RESOLUTION_NOT_SUPPORTED The GStreamer Digicam has not this resolution capability.
G_DIGICAM_ERROR_LOCK_NOT_POSSIBLE These lock combination was impossible to perform.
G_DIGICAM_ERROR_ZOOM_NOT_SUPPORTED The GStreamer Digicam has not zoom capabilities.
G_DIGICAM_ERROR_ZOOM_OUT_OF_RANGE The zoom value is out of range.
G_DIGICAM_ERROR_AUDIO_NOT_SUPPORTED These audio setting was impossible to perform.
G_DIGICAM_ERROR_PREVIEW_NOT_SUPPORTED The preview operations are not supported.

g_digicam_error_quark ()

GQuark              g_digicam_error_quark               (void);

Creates a new GQuark for error managing.

Returns : the GQuark

g_digicam_error_new ()

GError*             g_digicam_error_new                 (GDigicamError error_id,
                                                         const gchar *str,
                                                         ...);

Creates a new GDigicam Gerror with the proper id and string

error_id : the error id
str : strings to be shown on error message
... : variable arguments following the format as in printf function.
Returns : the new GDigicam GError

g_digicam_set_error ()

void                g_digicam_set_error                 (GError **orig_error,
                                                         GDigicamError error_id,
                                                         const gchar *str,
                                                         ...);

Sets or creates a gdigicam error with the proper id and string

orig_error : the original GError
error_id : the error id to set
str : strings to be shown on error message
... : variable arguments following the format as in printf function.