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

_get_engage_page raises TypeError when request is rate limited #51

Open
MaryFletcher opened this issue Dec 1, 2022 · 0 comments
Open

Comments

@MaryFletcher
Copy link

_get_engage_page raises "TypeError: the JSON object must be str, bytes or bytearray, not NoneType" when the request fails with a 429 rate limited response.

The call to self.request in _get_engage_page on line 1956 doesn't return a value for HTTP error codes below 500. (See the logic for handling HTTP errors in request.) The next line in _get_engage_page calls json.loads(response) where response is None and a TypeError is raised.

I'm hitting the following:

WARNING: The server couldn't fulfill the request.
WARNING: Error code: 429
WARNING: Reason: Too Many Requests
...
File "/var/task/mixpanel_api/__init__.py", line 1631, in _get_engage_page
data = json.loads(response)
File "/var/lang/lib/python3.9/json/__init__.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
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

No branches or pull requests

1 participant