-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extend error message for chown function #1930
Conversation
Robot Results
Passed Tests
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already a nice improvement. However, this can be improved a bit more.
Now, we have this error:
$ tedge --init
Error: Failed to change owner: "/var/log/tedge".
But it would be good to the user what need to do using anyhow::with_context
in tedge::initialize_tedge()
to get:
$ tedge --init
Error: Failed to initialize tedge. You have to run tedge with sudo.
Caused by:
Failed to change owner: "/var/log/tedge".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I feel its good to add some unit tests.
One can add a system test, but I see no point to have unit tests. |
Changed for tedge and all plugins that have an initialization process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
Please fix the typo that is in all the error messages (missing the article the).
Signed-off-by: Krzysztof Piotrowski <Krzysztof.Piotrowski@inetum.com>
7cadbe9
to
5c3a4bb
Compare
Proposed changes
Small improvement to the error messages created by tedge init commands that was mentioned in #1795. Issue only happened when we wanted to change the owner/group of the file. The problem was with chown that handled errors by itself but did not provide any information about directory, file etc.
Types of changes
Paste Link to the issue
#1795
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments