The function handle_errors scans for specific strings and when the test "Insufficient funds" is in the response body, an exception is thrown. But the expected behaviour would be, that the closed orders are just returned.
Code
results = []
offset = 0
since = time.time()
since = since - timedelta(days=365).total_seconds()
since = round(since * 1000)
while True:
try:
results = self._client.fetch_closed_orders(since=since, params={'ofs': offset})
trades += results
print(f'fetched orders: {len(trades)}')
if len(results) > 0:
offset += len(results)
except:
traceback.print_exc()
if len(results) < 50:
break
Operating System
mac
Programming Languages
Python
CCXT Version
4.3.51
Description
querying
fetch_closed_orders
leads to an exception, when there is a cancelled order with insufficient funds.The included order which leads to the exception is:
The function
handle_errors
scans for specific strings and when the test "Insufficient funds" is in the response body, an exception is thrown. But the expected behaviour would be, that the closed orders are just returned.Code