fireblocks-sdk-py icon indicating copy to clipboard operation
fireblocks-sdk-py copied to clipboard

get_users() crashes

Open knaperek opened this issue 1 year ago • 1 comments

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):

  • Python Version: [3.8, 3.9]
  • fireblocks-sdk version: [1.23.0, 2.2.1]

knaperek avatar Jan 02 '24 06:01 knaperek

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).

knaperek avatar Jan 11 '24 16:01 knaperek