Closed Rishirandhawa closed 3 years ago
Thats not a "bug". Yes you can receive also results for example. Just add an exception for keyerror and print the receive which cause the KeyError. then you see what you have received and does not fit for stream_data['data']
,
Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])
Select one:
Environment
What kind of internet connection do you have?
Average system load (CPU)
Intel Xenon```
Operating System? (include version)
Options
Which endpoint do you connect?
Include here the response of 'python --version' AND 'python3 --version'
Include here the response of 'python3 -m pip --version' or 'pip3 --version'
Did you upgrade to the latest release version with
pip install unicorn-binance-websocket-api --upgrade
?Please control what version you are using with this script and post the output: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/tools/get_used_module_version.py
Traceback (most recent call last): File "binance_futdb_soc_v0.py", line 323, in
unicorn_fied_stream_data = UnicornFy.binance_com_websocket(oldest_stream_data_from_stream_buffer)
File "/usr/local/lib/python3.8/dist-packages/unicorn_fy/unicorn_fy.py", line 88, in binance_com_websocket
return UnicornFy.binance_websocket(stream_data_json, exchange="binance.com", show_deprecated_warning=False)
File "/usr/local/lib/python3.8/dist-packages/unicorn_fy/unicorn_fy.py", line 287, in binance_websocket
if stream_data['data']['e'] == 'aggTrade':
KeyError: 'data'```
Process terminates with above error randomly. Seems for some records 'data' is not a valid field