GError propagation
Johan Bilien
jobi at via.ecp.fr
Wed Jun 27 04:12:54 PDT 2007
Hi,
Here's my current understanding of how errors from remote methods are
sent back to the caller:
Current GLib bindings allow the proxied method to take a GError as
argument, and this error if set by the remote method is passed back to
the caller through another GError in the callback.
But this second GError differs from the first one in that the domain is
set to DBUS_GERROR and the code to DBUS_GERROR_REMOTE_EXCEPTION. To get
the the original domain and code one has to call dbus_g_error_get_name,
which returns something like:
org.freedesktop.DBus.GLib.UnmappedError.SomeDomainErrorQuark.Code42
Caller can extract the domain / code from this.
I would have expected that the domain and error would just be propagated
to the caller as is. The current way makes the remote-nature of the
method very apparent on both server and client sides, and getting the
actual domain / code is rather involved.
Why not pass the error domain (via a g_quark_to_string on server then
g_quark_from_string on the client) and code directly? D-Bus-specific
errors would still be signalled via the DBUS_GERROR domain.
Thanks, sorry if I miss something obvious.
--
Johan Bilien
<jobi at via.ecp.fr>
More information about the dbus
mailing list