Include response headers in exceptions
I wanted to honor Retry-After when handling 429, but response headers weren't available. This PR adds thems to APIError.
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
+1.
Any chance this can get looked at for merging? We're looking to start using this package on our end when integrating with Chargebee and https://apidocs.chargebee.com/docs/api/error-handling?lang=python#error_handling mentions the best practice is to handle this header when rate limited.
Hi @brian-vanderford & @MikeFE, sorry for the delay! This has been included in v2.47.1. Could you please test it and let us know if it works?
Hi @brian-vanderford & @MikeFE, sorry for the delay! This has been included in v2.47.1. Could you please test it and let us know if it works?
Yeah it works, thanks a lot!
I wrote a quick script to hit the test site API and get rate limited. http_headers is now in the exception:
It came out as an OperationFailedError w/ http_code=429, error_code='api_request_limit_exceeded'. http_headers includes Retry-After: