Skip to content

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.

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