fireblocks / fireblocks-sdk-py

Official Python SDK for Fireblocks API
http://docs.fireblocks.com/api/swagger-ui/
MIT License
51 stars 40 forks source link

JSONDecodeError on 404 #60

Closed jalaziz closed 2 years ago

jalaziz commented 2 years ago

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 a JSONDecodeError. This propagates to the caller instead of being correctly handled and logged.

To Reproduce Steps to reproduce the behavior:

  1. Use the SDK to lookup a non-existent transaction
  2. 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):

yarinvak commented 2 years ago

Thanks for your report! Fixed in https://github.com/fireblocks/fireblocks-sdk-py/releases/tag/v1.12.1