In some cases, when receiving a 404 from the server, the response is HTML and not JSON. In this case, response.json() will throw a JSONDecodeError. This propagates to the caller instead of being correctly handled and logged.
To Reproduce
Steps to reproduce the behavior:
Use the SDK to lookup a non-existent transaction
Observe the JSONDecodeError on the 404
Expected behavior
Non-JSON response codes should correctly be handled and not result in an exception.
Versions (please complete the following information):
Describe the bug
In some cases, when receiving a 404 from the server, the response is HTML and not JSON. In this case,
response.json()
will throw aJSONDecodeError
. This propagates to the caller instead of being correctly handled and logged.To Reproduce Steps to reproduce the behavior:
JSONDecodeError
on the 404Expected behavior Non-JSON response codes should correctly be handled and not result in an exception.
Versions (please complete the following information):