Project

Profile

Help

Story #7117

As a plugin writer, I can be in control when the server returns a 400+ response code

Added by bmbouter 29 days ago. Updated 10 days ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
No
Tags:
Sprint:
Sprint 78

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

Blocks RPM Support - Issue #7095: Pulp 3 Sync issue (.treeinfo)MODIFIED<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision ea18dc97 View on GitHub
Added by Fabricio Aguiar 10 days ago

HttpDownloader control on response codes 400+

https://pulp.plan.io/issues/7117 closes #7117

History

#1 Updated by bmbouter 29 days ago

  • Blocks Issue #7095: Pulp 3 Sync issue (.treeinfo) added

#2 Updated by mrkashif 28 days ago

Had similar issue while trying to implement a submission form plugin here. Still looking for a solution.

#3 Updated by bmbouter 24 days ago

  • Groomed changed from No to Yes
  • Sprint set to Sprint 77

Adding to sprint after grooming at pulpcore planning meeting on July 14th.

#4 Updated by rchan 11 days ago

  • Sprint changed from Sprint 77 to Sprint 78

#5 Updated by fao89 10 days ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89

#6 Updated by pulpbot 10 days ago

  • Status changed from ASSIGNED to POST

#7 Updated by Anonymous 10 days ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

Please register to edit this issue

Also available in: Atom PDF