Bug 87249 - MSG: improve some argument validity check error messages
Summary: MSG: improve some argument validity check error messages
Status: NEW
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-11 22:27 UTC by Morten Hustveit
Modified: 2015-02-04 16:47 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Morten Hustveit 2014-12-11 22:27:46 UTC
Observed behavior:

[bob@a00:~]$ sudo systemctl enable /foo/bar.service
Failed to execute operation: Invalid argument

Expected behvaior:

[bob@a00:~]$ sudo systemctl enable /foo/bar.service
Unable to create symbolic link /etc/systemd/system/bar.service: target already exists

Details:

It seems that the systemd code generally passes error information as a single numeric code, even across contexts where the caller cannot know what the error code applies to.  This problem is further exacerbated by systemctl itself not doing any work; attempting to run systemctl under strace will not reveal additional context.

I would suggest making a per-thread error description string that takes precedence over errno if set, maybe something like this: https://gist.github.com/mortehu/df056c55958723b6836e
Comment 1 Lennart Poettering 2015-02-04 16:47:01 UTC
We actually pass back descriptive dbus errors in many cases, but not in all.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.