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
Add error messages for url helper calls #3041
base: master
Are you sure you want to change the base?
Conversation
Rpm allows URLs as cli parameters. The files are then automatically downloaded with %_urlhelper which defaults to curl(1). For far failures have been ignored right away and error messages are generated later when the file was not found on disk. Issue a meaningful error message at least when the help program is missing. This allows not to ship curl with rpm while still giving the user a chance to find out what is going on. Related: rhbz#2216754
Give error message if the urlhelper failed (exited with a non zero return code). This is not quite ideal as the error message from the helper (typically curl) itself is still not shown but give the user at leat a hint what is going on.
There should be a test for the case where the urlhelper is missing - it's what we can easily test, and also happens to be the case we're also most interested in for the bug.
Like I said (elsewhere), I've poked at this thing before. And I remember now, the reason I abandoned it was because I didn't like the "improved" behavior that great either - the latter message is pretty misleading even if the reason is in the line above. |
Yes, this isn't a great solution. But it at least gives the user a fighting chance of figuring out what's happening here. I agree we would want a better solution but there currently just isn't a way to hand over the error code. Adding a test case is easy if we decide we actually want to go this way. |
Hmm, and of course we have entirely different way of reporting the error on install, eg:
Which isn't so bad. But probably --import and all have their own more cryptic variants like the query above. Anyway, if we accept that we call rpmlog() from that location, it is an improvement for the user. Which is what matters in the end I guess. Besides tests there are some improvements you can make here: |
Rpm allows URLs as cli parameters. The files are then automatically
downloaded with %_urlhelper which defaults to curl(1). For far failures
have been ignored right away and error messages are generated later when
the file was not found on disk.
Issue a meaningful error message at least when the help program is
missing. This allows not to ship curl with rpm while still giving the
user a chance to find out what is going on.
Related: rhbz#2216754