-
Notifications
You must be signed in to change notification settings - Fork 241
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
Crash when an release asset doesn't exist #130
Crash when an release asset doesn't exist #130
Conversation
Currently, the script crashes whenever a release asset is unable to download (for example a 404 response). This change instead logs the failure and allows the script to continue. No retry logic is enabled, but at least it prevents the crash and allows the backup to complete. Retry logic can be implemented later if wanted. closes josegonzalez#129
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.
Maybe this should use the same pattern as _get_response
for error handles/should continue? Personally, I think these should be logged to stderr
using log_warning
with messaging along the lines of "Failed to download asset... skipping...".
but you should get an opinion from @josegonzalez
Use |
@josegonzalez Thank's for being so responsive with these PRs! I've made the requested change. |
@whwright I agree. I'm pretty new to Python and also wanted to keep my changes minimal, so I didn't go that route, but that does seem like a better idea. If @josegonzalez wants, I can take a stab at creating that function. |
@einsteinx2 go for it, its OSS, so we can take some time to level up your python while we're here :) |
Sounds good, I'll give it a shot then :) I really like this script, and as I've been using it and reading the other open issues I keep finding other little things I want to improve, plus it's been fun getting up to speed on Python, so I expect to be sending more PRs your way after I finish this bit ;) |
Hmm so as I'm diving into this I noticed that the For example, it looks like they were meant to be written to collect errors during the retry process, but that's not how they're being used in practice. For example Then I started refactoring the asset downloading to share those same error handling functions, but then those needed refactoring, which meant I'm going to put this aside for the moment so I can look at it with a fresh head later and work on one of the other simpler tickets I posted for the time being then come back to this. |
@josegonzalez Given the scope of the changes necessary to change the error handling and the fact that this PR has already been tested to fix the issue, I'm thinking maybe it would be better to merge this in now as-is and then I can make a new issue to refactor the error handling as that's really a separate task unrelated to this bug fix. |
Created a new issue specifically for refactoring the error handling code here: #138 As of right now, I can't use the script as-is for my personal backups until this PR is merged without using a custom branch including these changes, which makes it harder to work on the script as I have to keep two copies around, one with these changes and then the main repo and constantly cherry-pick in all the other new changes to my custom branch. It would be easier if this was part of |
Currently, the script crashes whenever a release asset is unable to download (for example a 404 response). This change instead logs the failure and allows the script to continue. No retry logic is enabled, but at least it prevents the crash and allows the backup to complete. Retry logic can be implemented later if wanted.
closes #129
Original result when asset fails to download:
Output with this change implemented: