ErrorG

The GError structure contains information about an error that has occurred.

Constructors

this
this(GError* gError, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(GQuark domain, int code, string message)

Creates a new GError; unlike g_error_new(), message is not a printf()-style format string. Use this function if message contains text you don't have control over, that could include printf() escape sequences.

this
this(GQuark domain, int code, string format, void* args)

Creates a new GError with the given domain and code, and a message formatted with format.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

copy
ErrorG copy()

Makes a copy of error.

free
void free()

Frees a GError and associated resources.

getErrorGStruct
GError* getErrorGStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

matches
bool matches(GQuark domain, int code)

Returns TRUE if error matches domain and code, FALSE otherwise. In particular, when error is NULL, FALSE will be returned.

Static functions

propagateError
void propagateError(ErrorG dest, ErrorG src)

If dest is NULL, free src; otherwise, moves src into *dest. The error variable dest points to must be NULL.

setErrorLiteral
void setErrorLiteral(ErrorG err, GQuark domain, int code, string message)

Does nothing if err is NULL; if err is non-NULL, then *err must be NULL. A new GError is created and assigned to *err. Unlike g_set_error(), message is not a printf()-style format string. Use this function if message contains text you don't have control over, that could include printf() escape sequences.

Variables

gError
GError* gError;

the main Gtk struct