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

get_users() crashes #153

Open knaperek opened 7 months ago

knaperek commented 7 months ago

Describe the bug get_users() crashes with

FireblocksApiException: Got an error from fireblocks server: { "message": "ok", "code": 0}

To Reproduce Steps to reproduce the behavior:

  1. initialize the SDK
  2. call .get_users()

Expected behavior Should return the list of users.

Versions (please complete the following information):

knaperek commented 7 months ago

Alright, I've partially figured this out. At least the SDK part.

The exception was being thrown because the server responded with 403. Unfortunately, the FireblocksApiException did not show nor preserve this original error in any way so it was very unclear what happened.

Looking at the response processing and FireblocksApiException exception, I'm proposing a fix and a minor refactoring to help with such issues in the future, in this pull request: PR#159

What remains a mystery (and probably a server-side bug) is why the json message says "ok" even though on the HTTP level an error is indicated (403).