When Binance API is sending an unexpected response text, it sometimes doesn't have "code" or "msg" fields in the response and thus the following exception occurs:
File "/usr/local/lib/python3.8/dist-packages/binance/exceptions.py", line 14, in __init__ self.code = json_res['code'] KeyError: 'code'
This patch is to add a default handling when key is not present in JSON response.
When Binance API is sending an unexpected response text, it sometimes doesn't have "code" or "msg" fields in the response and thus the following exception occurs:
File "/usr/local/lib/python3.8/dist-packages/binance/exceptions.py", line 14, in __init__ self.code = json_res['code'] KeyError: 'code'
This patch is to add a default handling when key is not present in JSON response.