1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00

core/dbus-timer: improve error messages

This commit is contained in:
Yu Watanabe 2017-12-14 21:52:47 +09:00
parent afcb1cd3a3
commit 1e3b7b0ec8

View File

@ -200,7 +200,7 @@ static int bus_timer_set_transient_property(
b = timer_base_from_string(name);
if (b < 0)
return -EINVAL;
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unknown timer base");
r = sd_bus_message_read(message, "t", &u);
if (r < 0)
@ -235,6 +235,8 @@ static int bus_timer_set_transient_property(
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
r = calendar_spec_from_string(str, &c);
if (r == -EINVAL)
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid calendar spec");
if (r < 0)
return r;