You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
20241128104641|ERROR|Unable to decode JSON response, got passed response with code "200" please check your endpoint configuration or API key
Traceback (most recent call last):
File "/root/.pyenv/versions/3.13.0/envs/base/lib/python3.13/site-packages/requests/models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/root/.pyenv/versions/3.13.0/lib/python3.13/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
~~~~~~~~~~~~~~~~~~~~~~~^^^
File "/root/.pyenv/versions/3.13.0/lib/python3.13/json/decoder.py", line 344, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.pyenv/versions/3.13.0/lib/python3.13/json/decoder.py", line 362, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/.pyenv/versions/3.13.0/envs/base/lib/python3.13/site-packages/reportportal_client/core/rp_responses.py", line 90, in json
self.__json = self._resp.json()
~~~~~~~~~~~~~~~^^
File "/root/.pyenv/versions/3.13.0/envs/base/lib/python3.13/site-packages/requests/models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Describe the bug
client-Python library can crash the execution process, if it wasn't able to decode responded JSON payload. The lib cannot intercept "JSONDecodeError" exception, since it's imported from the "json" package. But "requests" package can also raise "JSONDecodeError" exception from the "simplejson" package, if it's installed in the environment. Thus, both exception must be handled here: https://github.com/reportportal/client-Python/blob/develop/reportportal_client/core/rp_responses.py#L91
Steps to Reproduce
Expected behavior
Both exception ("JSONDecodeError" from "json" and "simplejson" pcakges) must be handled here: https://github.com/reportportal/client-Python/blob/develop/reportportal_client/core/rp_responses.py#L91
Actual behavior
Only "JSONDecodeError" from "json" package is handled here: https://github.com/reportportal/client-Python/blob/develop/reportportal_client/core/rp_responses.py#L91
Package versions
reportportal-client==5.5.8
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: