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
Incorrect error raised when max retries are exceeded #572
Comments
we just reraise the error from the responses/responses/__init__.py Line 1036 in 1db612d
basically, exception must include where do they append the reason? |
Yup, that is the suspected bug/deviation from the behavior of the
It looks like that logic lives in the urllib3 library. Here is the basic logic in the It appears that any As linked before the Perhaps a reasonable implementation would be to assume a Though it could be reasonable to add support for |
I'm having this exact issue |
@1Mark @jared-duo should fix the issue |
Describe the bug
When testing retry logic a
urllib3.exceptions.MaxRetryError
is raised instead of arequests.exceptions.RetryError
.Additional context
No response
Version of
responses
0.21.0
Steps to Reproduce
Expected Result
Both tests pass. More specifically that responses follows the logic (original - v2.5.0, most recent version - v2.28.1) introduced in requests v2.5.0 (the version that introduced the ability to use urllib3's Retry object with HTTPAdapters ) that converts
urllib3.exceptions.MaxRetryError
s intorequests.exceptions
exceptions, specificallyResponseError
s becomingRetryError
s.Actual Result
The responses based test does not pass, as it raises
urllib3.exceptions.MaxRetryError
instead of arequests.exceptions.RetryError
.The text was updated successfully, but these errors were encountered: