[systemd-devel] Reasoning behind sd_bus_error argument to sd_bus_call?

Lennart Poettering lennart at poettering.net
Tue Mar 31 14:46:26 UTC 2020


On Mi, 18.03.20 12:14, Daan De Meyer (daan.j.demeyer at gmail.com) wrote:

> I completely agree that for errors returned by the service, a D-Bus error
> is a lot better. However, from what I understand of sd-bus, any errors
> returned by the service are encoded in the reply returned by sd_bus_call
> and you use sd_bus_message_is_method_error and sd_bus_message_get_error on
> the reply to get the actual service error. Where does that leave the
> sd_bus_error argument of sd_bus_call?

We *either* return an error and fill in sd_bus_error (on error) *or*
we return a reply msg (on success). i.e. you won't get an
sd_bus_message object from sd_bus_call() at all on error, hence
nothing you could look into with sd_bus_message_get_error().

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list