Skip to content
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

[#248] Unity: retry not work #251

Merged
merged 1 commit into from
Nov 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions storops/connection/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,9 @@ def request(self, full_url, method, **kwargs):
except ValueError:
pass

# The reason why not raise if `status_code` >= 400 is that we don't
# want to raise if code is 404 - Not Found. The upper layer will check
# the returned resource and raise `ResourceNotFoundError` or some thing
# like it.
if resp.status_code >= 400 and resp.status_code != 404:
# These errors should be raised directly, do NOT retry any more,
# like 401 - unauthorized, 503 - service unavailable.
if resp.status_code in [401, 503]:
raise exceptions.from_response(resp, method, full_url)

return resp, body
Expand Down