Exceptions thrown by requests (which are subclasses of IOError) are right now caught, but ignored. This results in a zero exit code, even if the download fails (c.f. https://bugzilla.redhat.com/show_bug.cgi?id=2096624 ).
This PR changes the download() function to re-raise any IOErrors that occur.
Additionally, the main() function is slightly refactored, to collect requested tasks and execute them in a loop. This way, any error handling (i.e. catching IOError and returning a non-zero exit code in that case) can happen in one place.
Exceptions thrown by requests (which are subclasses of IOError) are right now caught, but ignored. This results in a zero exit code, even if the download fails (c.f. https://bugzilla.redhat.com/show_bug.cgi?id=2096624 ).
This PR changes the download() function to re-raise any IOErrors that occur.
Additionally, the main() function is slightly refactored, to collect requested tasks and execute them in a loop. This way, any error handling (i.e. catching IOError and returning a non-zero exit code in that case) can happen in one place.