-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Handle Requests' ChunkedEncodingError
exceptions when downloading files
#1960
Comments
Agreed we should be catching any error that clearly comes from the download - the question is how to determine what that canonical list is. |
I'd like to work on this. I agree with @freakboy3742, catching all the errors would be a good idea. Requests handles the possible underlying urllib3 errors and translates them into
|
Wow... that's a seriously thorough analysis - nice work! I agree that we don't need to keep the fidelity of all these different failure modes - "download didn't work" (with some extra error message context if it's illuminating) is enough granularity at the level that Briefcase is surfacing these errors. At least at present, On a related note - if you're up for a slightly larger piece of related work, I'll draw your attention to #2039. I'm fairly sure this ticket can be closed out with a relatively minor modification to exception handling; but if there's a need for anything more substantial, it might be worth taking a step back and re-visiting the assumption that requests is the right tool for the job in this case. |
Thanks for the tip on that related issue. I would be very interested to work on that httpx issue. I'll try the simple (:crossed_fingers:) approach we've discussed here for this exception. While httpx's streaming API is slightly different to requests, I think the changes in this particular code path to use httpx will mostly be in Well, in any case, I'll try out the simple fix we've discussed and see how it goes 🙂 |
Describe the bug
A download failure mode for Requests is a
ChunkedEncodingError
and Briefcase does not handle this when downloading arbitrary files.For instance:
Steps to reproduce
Cannot be reproduced at will.
Expected behavior
Catch
ChunkedEncodingError
for file downloads. Or maybe just catch any exception that Requests can raise since they should all mean the same thing: the download was unsuccessful.Screenshots
No response
Environment
Logs
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: