X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=glib%2Fgerror.c;h=4eed58e9b7980d32d3905fc391eb195afacf3b67;hb=2a53b4d0e2c98a14aedf31e38f0ad1fb2e8fe26f;hp=a542611de35a4ebbf3e89b08ffbc271387faa6d4;hpb=20f4d1820b8d4d0fc4447188e33efffd6d4a88d8;p=platform%2Fupstream%2Fglib.git diff --git a/glib/gerror.c b/glib/gerror.c index a542611..4eed58e 100644 --- a/glib/gerror.c +++ b/glib/gerror.c @@ -271,7 +271,11 @@ * - If there's a "generic" or "unknown" error code for unrecoverable * errors it doesn't make sense to distinguish with specific codes, * it should be called __ERROR_FAILED, - * for example %G_SPAWN_ERROR_FAILED. + * for example %G_SPAWN_ERROR_FAILED. In the case of error code + * enumerations that may be extended in future releases, you should + * generally not handle this error code explicitly, but should + * instead treat any unrecognized error code as equivalent to + * FAILED. * * Summary of rules for use of #GError: * @@ -502,6 +506,13 @@ g_error_copy (const GError *error) * otherwise. In particular, when @error is %NULL, %FALSE will * be returned. * + * If @domain contains a `FAILED` (or otherwise generic) error code, + * you should generally not check for it explicitly, but should + * instead treat any not-explicitly-recognized error code as being + * equilalent to the `FAILED` code. This way, if the domain is + * extended in the future to provide a more specific error code for + * a certain case, your code will still work. + * * Returns: whether @error has @domain and @code */ gboolean @@ -593,6 +604,10 @@ g_set_error_literal (GError **err, * * If @dest is %NULL, free @src; otherwise, moves @src into *@dest. * The error variable @dest points to must be %NULL. + * + * Note that @src is no longer valid after this call. If you want + * to keep using the same GError*, you need to set it to %NULL + * after calling this function on it. */ void g_propagate_error (GError **dest,