[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] g_error considered harmful



On Tue, Jan 17, 2012 at 04:52:19PM +0100, Christophe Fergeau wrote:
> Looking at what gtk+ does, it has gtk_init which is documented to abort,
> and gtk_init_check which apps can use when they need this. g_type_init has
> no _check alternative, but it does a few sanity checks at runtime using
> g_assert.
> 
> I like the gtk+ approach of aborting in the function most commonly use as
> it avoids tracking down bugs caused by the _init failing but not being
> checked by the application developer. I think we should do the same and add
> _check functions if/when needed (this is me being lazy)

Actually these _init_check functions already exist, so we have
libvirt_{glib,gconfig,gobject}_init which abort, and
libvirt_{glib,gconfig,gobject}_init_check which return FALSE and an error
when there's a problem during initilization.

This mail should be read as a "ping?" on this series :)

Christophe

Attachment: pgpNvTQiES3dA.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]