]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: slightly improve error message on load errors
authorLennart Poettering <lennart@poettering.net>
Fri, 12 Feb 2021 22:39:49 +0000 (23:39 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 13 Feb 2021 08:46:39 +0000 (17:46 +0900)
Let's be a bit more helpful when refusing jobs on units that failed to
load properly. We already have explicit D-Bus errors for the error
conditions that are common and expected (such as "not found"), but for
the rest we so far generate a fairly cryptic message.

Let's try to be friendlier towards users and suggest what to do on such
errors.

Fixes: #16487
src/core/dbus-unit.c

index 90bf5514a3eb25f5a7cbb323958da99378cc9c09..8d92a4e763f58522833e5a8bf6d2f1cc17d9cf10 100644 (file)
@@ -2356,7 +2356,8 @@ int bus_unit_validate_load_state(Unit *u, sd_bus_error *error) {
                 return sd_bus_error_setf(error, BUS_ERROR_BAD_UNIT_SETTING, "Unit %s has a bad unit file setting.", u->id);
 
         case UNIT_ERROR: /* Only show .load_error in UNIT_ERROR state */
-                return sd_bus_error_set_errnof(error, u->load_error, "Unit %s failed to load properly: %m.", u->id);
+                return sd_bus_error_set_errnof(error, u->load_error,
+                                               "Unit %s failed to load properly, please adjust/correct and reload service manager: %m", u->id);
 
         case UNIT_MASKED:
                 return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit %s is masked.", u->id);