GNOME Bugzilla – Bug 665375
avahi: Error handling is part of -client and not -gobject.
Last modified: 2018-05-22 14:15:56 UTC
Created attachment 202578 [details] [review] Pulls the errordomain Error and strerror into -common. The avahi arrordomain Error was left in -gobject but needs to reside in -client, as functions within -client throw such errors. The error was introduced because errordomain Error was pointing to the wrong header files. It wasn't obvious from looking at the vapi that those were defined in avahi-common (corresponding to avahi-client.vapi).
... and fixes the referenced header files.
Is any additional info needed?
From what I can tell, avahi-client only defines the enum but not the errordomain. The errordomain still needs avahi-gobject (GA_ERROR). I suspect that this patch would break code that uses Avahi.Error in throw and catch clauses as ga-error.h will no longer be included and the prefix will be wrong for the errordomain quark.
(In reply to comment #3) > From what I can tell, avahi-client only defines the enum but not the > errordomain. The errordomain still needs avahi-gobject (GA_ERROR). I suspect > that this patch would break code that uses Avahi.Error in throw and catch > clauses as ga-error.h will no longer be included and the prefix will be wrong > for the errordomain quark. Thanks for this feedback. So the thing to allow a split between -gobject and -client is to remove all "throw Error" from -client and use the return value instead? This way I could pull the errordomain again back into -gobject, and the only way to handle errors in -client would be to look at the return value.
The scheme above actually doesn't work, as some methods are members (e.g. Domain.service_name_split), and those can't be easily moved into gobject. Therefore the only solution is see is breaking b.c. and removing the wrappers which throw errors. Namely StringList.parse, Domain.service_name_join and Domain.service_name_split . Or am I missing something?
Created attachment 205134 [details] [review] add deprection attributes
The patch above deprectaes the wrappers in avahi-client which throw errors and thus depend on gobject (gerror). This is not accetable for the non-gobject lib avahi-client. The gerror will be removed at some point in the future, before a 0.16 release.
*** Bug 667814 has been marked as a duplicate of this bug. ***
commit 307da0c2e0f7ed4320ba7eec345949edd0e36fbf Author: Fabian Deutsch <fabian.deutsch@gmx.de> Date: Fri Jan 13 11:26:48 2012 -0800 avahi-client: deprecated wrapper methods which throw errors First step towards fixing 665375.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/258.