From 1e3b7b0ec8bb9678e8f569272077585eefe1419f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 14 Dec 2017 21:52:47 +0900 Subject: [PATCH] core/dbus-timer: improve error messages --- src/core/dbus-timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;