Error


Object Hierarchy:

GLib.Error GLib.Error GLib.Error

Description:

[ Compact ]
[ ErrorBase ]
[ CCode ( copy_function = "g_error_copy" , free_function = "g_error_free" , type_id = "G_TYPE_ERROR" ) ]
public class Error

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

Example: Exception sample:

public static void dummy () throws FileError {
throw new FileError.ACCES ("My error msg");
}

public static int main (string[] args) {
try {
dummy ();
} catch (FileError e) {
// Output:
// ``Message: "My error msg"``
// ``Error code: FileError.EXIST = 2``
// ``FileErrors identification: 51``
print ("Message: \"%s\"\n", e.message);
print ("Error code: FileError.EXIST = %d\n", e.code);
print ("FileErrors identification: %" + uint32.FORMAT + "\n", e.domain);
return 0;
}
assert_not_reached ();
}

valac --pkg glib-2.0 GLib.Error.vala


Namespace: GLib
Package: glib-2.0

Content:

Static methods:

Creation methods:

Methods:

Fields: