Project:DUI

Class List Class Hierarchy
Summary: Ctors Methods Mixins

Module dglib.ErrorG

Class ErrorG

Implemented interfaces:


public class

ErrorG



GLib provides a standard method of reporting errors from a called function to the calling code.
(This is the same problem solved by exceptions in other languages.) It's important to understand that this method is both a data type (the GError object) and a set of rules. If you use GError incorrectly, then your code will not properly interoperate with other code that uses GError, and users of your API will probably get confused. First and foremost: GError should only be used to report recoverable runtime errors, never to report programming errors. If the programmer has screwed up, then you should use g_warning(), g_return_if_fail(), g_assert(), g_error(), or some similar facility. (Incidentally, remember that the g_error() function should only be used for programming errors, it should not be used to print any error reportable via GError.) Examples of recoverable runtime errors are "file not found" or "failed to parse input." Examples of programming errors are "NULL passed to strcmp()" or "attempted to free the same pointer twice." These two kinds of errors are fundamentally different: runtime errors should be handled or reported to the user, programming errors should be eliminated by fixing the bug in the program. This is why most functions in GLib and GTK+ do not use the GError facility.

Constructor Summary
(GError* gError)
          Creates a ErrorG from a GtkErrorG
()
          

Methods Summary
public GError* getG()
          
GError** getGA()
          
void free()
          Creates a new GError with the given domain and code, and a message formatted with format.
ErrorG copy()
          Makes a copy of error.
void propagateError(ErrorG src)
          Returns TRUE if error matches domain and code, FALSE otherwise.
void clearError()
          If err is NULL, does nothing.
String getMessage()
          
int getCode()
          
void dump()
          


getG

public GError* getG()

getGA

GError** getGA()



ctor(ErrorG)(GError* gError)
Creates a ErrorG from a GtkErrorG

Parameters:
*gtkWidget - the gtk struct address pointer

Returns:



ctor(ErrorG)()

free

void free()
Creates a new GError with the given domain and code, and a message formatted with format.

Parameters:
domain - error domain
code - error code
format - printf()-style format for error message
... - parameters for message format
domain - error domain
code - error code
message - error message
error - a GError

Returns:
a new GError Creates a new GError; unlike gErrorNew(), 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.
a new GError Frees a GError and associated resources.

copy

ErrorG copy()
Makes a copy of error.

Parameters:
error - a GError

Returns:
a new GError

propagateError

void propagateError(ErrorG src)
Returns TRUE if error matches domain and code, FALSE otherwise.

Parameters:
error - a GError
domain - an error domain
code - an error code
err - a return location for a GError, or NULL
domain - error domain
code - error code
format - printf()-style format
... - args for format If dest is NULL, free src; otherwise, moves src into *dest. *dest must be NULL.
dest - error return location
src - error to move into the return location

Returns:
whether error has domain and code 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.

clearError

void clearError()
If err is NULL, does nothing.
If err is non-NULL, calls gErrorFree() on *err and sets *err to NULL.

Parameters:
err - a GError return locatio

getMessage

String getMessage()

getCode

int getCode()

dump

void dump()