Errors

Errors — Error handling routines.

Synopsis

#define             osso_abook_check_disc_space         (parent)
#define             osso_abook_check_disc_space_full    (parent, path)
#define             osso_abook_handle_gerror            (parent, error)
#define             osso_abook_handle_estatus           (parent, error, book)
#define             OSSO_ABOOK_ERROR
enum                OssoABookError;
GQuark              osso_abook_error_quark              (void);
GError*             osso_abook_error_new_from_estatus   (EBookStatus status);

Description

This module describes the types of errors that can be returned by libosso-abook and provides several functions for handling them

Details

osso_abook_check_disc_space()

#define             osso_abook_check_disc_space(parent)

This function checks whether there is a 'reasonable' amount of disk space available. As a side-effect, if the disk space is too low, a warning banner will be displayed.

NOTE: It is recommended that applications avoid this function

parent : parent GtkWindow for error banner
Returns : TRUE if there is a "reasonable" amount of disk space available, FALSE otherwise.

osso_abook_check_disc_space_full()

#define             osso_abook_check_disc_space_full(parent, path)

This function is like osso_abook_check_disc_space, but checks for available space on the partition that contains path. Like osso_abook_check_disc_space, a warning banner will be displayed if sufficient disk space is not available.

NOTE: It is recommended that applications avoid this function

parent : parent GtkWindow for error banner
path : the path to
Returns : TRUE if there is a "reasonable" amount of disk space available, FALSE otherwise.

osso_abook_handle_gerror()

#define             osso_abook_handle_gerror(parent, error)

Displays a general error banner with a message appropriate for the specified GError. An error message will also be logged to stdout. In addition, error will be freed within this function, so you don't need to explicitly free it.

parent : The parent GtkWindow for error banner
error : the GError object to be handled

osso_abook_handle_estatus()

#define             osso_abook_handle_estatus(parent, error, book)

Displays a general error banner with a message appropriate for the specified EBookStatus. An additional error message will be logged to stdout

parent : the parent GtkWindow for error banner
error : the EBookStatus variable to handle
book : optional EBook associated with the error

OSSO_ABOOK_ERROR

#define OSSO_ABOOK_ERROR osso_abook_error_quark ()

enum OssoABookError

typedef enum {
        OSSO_ABOOK_ERROR_OFFLINE,
        OSSO_ABOOK_ERROR_EBOOK,
        OSSO_ABOOK_ERROR_CANCELLED,
        OSSO_ABOOK_ERROR_MAPS_FAILED,
} OssoABookError;

osso_abook_error_quark ()

GQuark              osso_abook_error_quark              (void);

osso_abook_error_new_from_estatus ()

GError*             osso_abook_error_new_from_estatus   (EBookStatus status);

Creates a GError of type OSSO_ABOOK_ERROR_EBOOK that represents the error status specified by status

status : an EBookStatus value
Returns : A newly-allocated GError, or NULL if status is E_BOOK_ERROR_OK.