From a70e2adf45818dc40a8b12b961d656363336786b Mon Sep 17 00:00:00 2001 From: David Brazda Date: Tue, 12 Dec 2023 21:26:24 +0100 Subject: [PATCH] bugfix --- v2realbot/interfaces/live_interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2realbot/interfaces/live_interface.py b/v2realbot/interfaces/live_interface.py index bbc6ed2..1da2572 100644 --- a/v2realbot/interfaces/live_interface.py +++ b/v2realbot/interfaces/live_interface.py @@ -162,7 +162,7 @@ class LiveInterface(GeneralInterface): return a.avg_entry_price, a.qty except (APIError, Exception) as e: #no position - if e.code == 40410000: return 0,0 + if hasattr(e, 'code') and e.code == 40410000: return 0,0 else: reason = "Exception when calling LIVE interface pos, REPEATING:" + str(e) + format_exc() print("API ERROR: Nepodarilo se ziskat pozici.", reason)