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

Return a emplty list if the content is invalid #32

Closed
wants to merge 2 commits into from
Closed

Return a emplty list if the content is invalid #32

wants to merge 2 commits into from

Conversation

peristeri
Copy link

If the json loads function raises, the return content is invalid,
the function should log the error and return an empty list.

If the json loads function raises, the return content is invalid,
the function should log the error and return an empty list.
@dpursehouse
Copy link
Collaborator

Returning an empty list might not always be appropriate. There are some endpoints that return a dict, or a string. Callers of those may not expect the return value to be a list.

It might be better to make it raise an error instead.

If the json loads function raises, the return content is invalid,
the function should log the error and return an empty list.
@dpursehouse
Copy link
Collaborator

Sorry for the delay. I didn't receive any email notification that you'd added a new commit.

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