Repository navigation
core: give a nicer error message on invalid aliases - #24728
Conversation
3c4069d to
923a5e8
Compare
|
|
||
| case -EXDEV: | ||
| r = sd_bus_error_setf(error, BUS_ERROR_BAD_UNIT_SETTING, | ||
| "\"%s\" is an invalid alias.", changes[i].path); |
There was a problem hiding this comment.
hmm, I think we should say in which way "invalid".
i.e. maybe \"%s\" unit alias doesn't match unit name or so
There was a problem hiding this comment.
I've used the generic message on purpose.
A that point - in dbus-manager.c - it is hard to say more; since UnitFileChange's instance is carrying an errno only.
It can be: invalid unit name, source-target mismatch or an incompatible suffix (these details should be logged by log_full_errno.
My point is, for the cli it is still better to see, that there is something wrong with an unit, instead of generic errno readout.
|
lgtm. i think the wording could be improve a tiny bit still, see above /cc @keszybz |
|
also see the messages generated in unit_file_dump_changes() for the EXDEV case. Might as well copy those message strings literally. |
|
Hmmm, there's more discrepancies between Also, please add a note in |
|
#25080 does some preparatory work. This pull request is still wanted. It should be rebased on top of that other one. |
739bbbc to
d245c65
Compare
|
Same comment as before: please add all missing cases to |
d245c65 to
624f788
Compare
624f788 to
52a71ad
Compare
Gives more descriptive (but general) error message on invalid alias; instead of
Invalid cross-device link.