-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Raise an error (or a warning) if a provided file is inaccessible #742
Comments
@jdmichaud Thank you for your issue :D, I'm dealing with something similar in #708, but I do get a warning when the path is wrong, which arguments are you passing when experience this issue? |
@zampierilucas If I am doing this: lab mr create --file /non/existent/file I get this error: 2021/09/22 08:10:34 ERROR: mr_create.go:234:aborting MR due to empty MR msg If I were to call In my case, I had to look around the issue tracker for a few minutes until I realized I had a subtle typo in the path. Even worse, if for example you use a path starting with |
This should be easy to warn on. I'll take a look. |
Currently, when the file specified with the -F or -f options does not exist, lab outputs a very generic error that is not helpful to users [prarit@prarit kernel-test]$ ~/git-kernel/github/lab/lab mr create 2021/09/22 07:14:40 ERROR: mr_create.go:289: empty MR message Check to see if the file exists and report a better error if the file is not present. For example, [prarit@prarit kernel-test]$ ~/git-kernel/github/lab/lab mr create -F /tmp/non-existent.file 2021/09/22 07:15:02 ERROR: mr_create.go:244: file /tmp/non-existent.file cannot be found Fixes zaquestion#742 Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Currently, when the file specified with the -F or -f options does not exist, lab outputs a very generic error that is not helpful to users [prarit@prarit kernel-test]$ ~/git-kernel/github/lab/lab mr create 2021/09/22 07:14:40 ERROR: mr_create.go:289: empty MR message Check to see if the file exists and report a better error if the file is not present. For example, [prarit@prarit kernel-test]$ ~/git-kernel/github/lab/lab mr create -F /tmp/non-existent.file 2021/09/22 07:15:02 ERROR: mr_create.go:244: file /tmp/non-existent.file cannot be found Fixes #742 Signed-off-by: Prarit Bhargava <prarit@redhat.com>
If the file provided to the
--file
option is not accessible (no read access or wrong path)lab
just fails silently as if no file were provided. It makes troubleshooting more difficult than it needs to be, for example if there is subtle typo in the path.Raising an error or at least a warning that the provided file is invalid would enhance the user experience.
The text was updated successfully, but these errors were encountered: