sending self defined errors over dbus

Steve Kreyer steve.kreyer at web.de
Fri Aug 3 07:07:07 PDT 2007


Hi,
Simon McVittie wrote:
> On Fri, 03 Aug 2007 at 14:14:18 +0200, Steve Kreyer wrote:
>   
>> dbus_g_error_domain_register (AUXIN_ERROR, NULL, AUXIN_TYPE_ERROR);
>>     
>
> You need to tell dbus-glib what the error prefix is for your errors, for
> instance:
>
> /* during initialization */
> dbus_g_error_domain_register (AUXIN_ERROR, "com.example.Auxin.Errors",
>     AUXIN_TYPE_ERROR);
> ...
> /* during runtime */
> g_set_error (error, AUXIN_ERROR, AUXIN_ERROR_IT_BROKE, "Something's wrong");
>
> That would give you errors of the form com.example.Auxin.Errors.ItBroke
> (where "ItBroke" is the value_nick member of the GEnumValue structure
> corresponding to AUXIN_ERROR_IT_BROKE).
>   
ok, that is what I searched for.

Many thanks,

Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20070803/c099be68/attachment.bin 


More information about the dbus mailing list