fireblocks-sdk-py
fireblocks-sdk-py copied to clipboard
get_users() crashes
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:
- initialize the SDK
- 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]
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).