From: Yu Watanabe Date: Thu, 14 Dec 2017 12:52:47 +0000 (+0900) Subject: core/dbus-timer: improve error messages X-Git-Tag: v237~218^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e3b7b0ec8bb9678e8f569272077585eefe1419f;p=thirdparty%2Fsystemd.git core/dbus-timer: improve error messages --- diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c index 3e64536b17d..12cebc2cccc 100644 --- a/src/core/dbus-timer.c +++ b/src/core/dbus-timer.c @@ -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;