Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@foutoucour
Copy link

@foutoucour foutoucour commented Dec 10, 2025

With this update, the HTTP headers are available in the HTTPException and its subclasses. It exposes the response context. We have this need at Autodesk because we hit GitHub's secondary rate limit. We want to use the header details to configure an optimized retry policy when we hit this limit.

We hit some 429 from GitHub due to secondary rate limit. The way to handle that, following the GitHub guidance, is to check the headers headers, which the library blocks. This PR works on this.

related to

@foutoucour foutoucour changed the title Add the forward of the headers in the HTTPExceptions Forward of the headers in the HTTPExceptions Dec 10, 2025
@foutoucour foutoucour marked this pull request as ready for review December 10, 2025 14:08
@brettcannon
Copy link
Collaborator

Can I ask how this is different from #226 ?

@foutoucour
Copy link
Author

I noted that the kwargs are not passed as an argument in some exceptions, like RateLimitExceeded or InvalidField. So even if we have the kwargs in the parent class HTTPException, they are not expressed in some subclass.
I saw that when I updated the tests.
I worked mainly on 4XX, while #226 has more the 3XX in mind, I think. Both seem complementary.

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (475f54f) to head (1d44a85).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #227   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          474       475    +1     
  Branches        78        78           
=========================================
+ Hits           474       475    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Jordi Riera <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants