On Thu, May 18, 2006 at 05:19:06PM -0700, Ben Pfaff wrote:
     
     > gboolean
     > my_other_function_that_can_fail(GError **err2)
     > {
     >   GError *err = NULL;
     >   my_function_that_can_fail(&err);
     >
     >
     >   if (g_error_matches (err, THIS_DOMAIN, THIS_CODE))
     >     {
     >       handle_the_mess();
     >       g_clear_error(&err);
     >       return TRUE;
     >     }    
     >   else
     >     {
     >       g_propogate_error(err2, err);
     >       g_clear_error(&err);
     >       return FALSE;
     >     }
     > }
     
     If this is the usage then it seems to me that you only need a
     unique code for the errors you want to special-case this way.
     You can use a generic code for other errors.
     
     How often do you want to special-case errors this way?  What
     situations have come up so far?

So far, only one.  I suppose we could have errors default to a
PSPP_GENERIC_ERROR value, and have particular values for the ones I
want to catch.  I don't know if this would cause problems with psppire
interacting with other esoteric gnome applications; I'll have to ask
someone who knows about such things.

J'

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: pgpnKUPlgdy2J.pgp
Description: PGP signature

_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to