binance / binance-connector-python

Simple connector to Binance Public API
MIT License
1.9k stars 493 forks source link

How does Binance Binance Public API Connector Python get the error location? , just report the error reason #211

Open 1163849662 opened 1 year ago

1163849662 commented 1 year ago

image

1163849662 commented 1 year ago

!/usr/bin/env python

import logging import time from binance.lib.utils import config_logging from binance.websocket.spot.websocket_api import SpotWebsocketAPIClient

config_logging(logging, logging.DEBUG)

def onclose(): logging.info("Do custom stuff when connection is closed")

sample code,error in print(1/0) def messagehandler(, message): logging.info(message) print(1/0)

my_client = SpotWebsocketAPIClient(on_message=message_handler, on_close=on_close)

my_client.aggregate_trades(symbol="BNBBUSD", limit=1, fromId=0)

time.sleep(2)

logging.info("closing ws connection") my_client.stop() 截屏2023-02-21 上午11 52 23

alplabin commented 2 months ago

@1163849662 Are you still experiencing this error with the latest version? I tried to replicate it but couldn't.