Skip to content

Conversation

@glensc
Copy link
Contributor

@glensc glensc commented Jan 23, 2022

This ensures 502 responses don't get json decode exceptions

  File "/python-3.10.1/lib/python3.10/site-packages/trakt/core.py", line 533, in _handle_request
    json_data = json.loads(response.content.decode('UTF-8', 'ignore'))
  File "/usr/local/Cellar/python@3.10/3.10.1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python@3.10/3.10.1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python@3.10/3.10.1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

glensc added a commit to glensc/python-pytrakt that referenced this pull request Oct 24, 2022
@glensc
Copy link
Contributor Author

glensc commented Oct 24, 2022

Carried to my fork:

@glensc glensc changed the title Feature: Add Bad Gateway exception [python-pytrakt] Feature: Add Bad Gateway exception Nov 2, 2022
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.

1 participant