Actions
Story #7117
closedAs a plugin writer, I can be in control when the server returns a 400+ response code
Start date:
Due date:
% Done:
100%
Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
No
Tags:
Sprint:
Sprint 78
Quarter:
Description
Background¶
Currently the HttpDownloader will raise an exception at response.raise_for_status()
anytime the server responds with a 400+ response code. The plugin writers are not in control of this.
In some cases a 404 should not raise an exception because a file being missing is normal. This is the case with pulp_rpm .treeinfo files. See https://pulp.plan.io/issues/7095 for that issue.
Proposal¶
Add a new hook method on HttpDownloader like this:
def raise_for_status(response):
response.raise_for_status()
Then HttpDownloader subclasses could intercept this call and customize it.
Related issues
Actions
HttpDownloader
control on response codes 400+https://pulp.plan.io/issues/7117 closes #7117