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

Raise exception on 503 error #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mattj-io
Copy link

I've seen 503 errors when iterating through large query sets, so raise an exception rather than falling through into the next code block.

Copy link
Owner

@pferate pferate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a new class, don't raise HttpServerError directly.

@@ -162,6 +162,8 @@ def _call(self, service_name, parameters=None, **kwargs):
raise exceptions.HttpUnauthorized
if response.status_code == 404:
raise exceptions.HttpNotFoundError
if response.status_code == 503:
raise exceptions.HttpServerError
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exceptions.HttpServerError is a base class for 5xx errors, not meant to be raised directly; similar to exceptions.HttpClientError.

If we are to raise an exception for 5xx, create a new class (based from HttpServerError), then raise that.

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