multiversx / mx-sdk-py-cli

Python Command Line Tools and SDK for interacting with the MultiversX blockchain and dApps.
Other
48 stars 36 forks source link

Catch API errors as "KnownError" and display them more nicely #412

Closed andreibancioiu closed 7 months ago

andreibancioiu commented 7 months ago

E.g. now:

Traceback (most recent call last):
  File "/home/user/multiversx-sdk/mxpy-venv/lib/python3.11/site-packages/multiversx_sdk_network_providers/proxy_network_provider.py", line 189, in do_post
    response.raise_for_status()
  File "/home/user/multiversx-sdk/mxpy-venv/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://devnet-gateway.multiversx.com/transaction/send