From 1c8b51a7b7fb92895f7cedb0f8bde34752685f4c Mon Sep 17 00:00:00 2001 From: zhangjiexian Date: Mon, 20 Mar 2023 23:45:49 +0800 Subject: [PATCH] show traceback msg while exception --- okx/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/okx/client.py b/okx/client.py index 920f8bb..62ee6cf 100644 --- a/okx/client.py +++ b/okx/client.py @@ -6,6 +6,8 @@ from . import consts as c, utils, exceptions import time +import traceback + class Client(object): def __init__(self, api_key = '-1', api_secret_key = '-1', passphrase = '-1', use_server_time=False, flag='1', base_api = 'https://www.okx.com',debug = False): @@ -49,7 +51,9 @@ class Client(object): try: response = self._request(method, request_path, params) break - except: + except Exception as e: + msg = traceback.format_exc() + print(msg) retry_times += 1 if retry_times > retry_times_max: print('reach max retry times, exit loop.')