Re: g_error considered harmful

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

 



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: pgprSZuSa6FGs.pgp
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]