From 98dcecb470462f19db071d623fba0933da4650c4 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 5 Jun 2018 14:25:35 +0800 Subject: [PATCH] =?UTF-8?q?[Mod]=E4=BF=AE=E6=94=B9vnokex=E7=9A=84=E6=96=AD?= =?UTF-8?q?=E7=BA=BF=E9=87=8D=E8=BF=9E=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/api/okex/vnokex.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/vnpy/api/okex/vnokex.py b/vnpy/api/okex/vnokex.py index 061c1b2e..0c17d3eb 100644 --- a/vnpy/api/okex/vnokex.py +++ b/vnpy/api/okex/vnokex.py @@ -1,15 +1,10 @@ # encoding: UTF-8 -''' -OKEX的高性能异步交易API - -Contributor:ipqhjjybj 大佳 -''' - from __future__ import print_function import hashlib import json +import traceback from threading import Thread from time import sleep @@ -104,9 +99,10 @@ class OkexApi(object): try: self.ws.send(j) - except websocket.WebSocketConnectionClosedException: + except: + msg = traceback.format_exc() + self.onError(msg) self.reconnect() - #---------------------------------------------------------------------- def reconnect(self):