Skip to content

Commit 355ffe7

Browse files
committed
AltMarkets: Fix error in cancel for order not found
1 parent 0174488 commit 355ffe7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hummingbot/connector/exchange/altmarkets/altmarkets_exchange.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,9 @@ async def _execute_cancel(self, trading_pair: str, order_id: str) -> str:
543543
raise
544544
except AltmarketsAPIError as e:
545545
errors_found = e.error_payload.get('errors', e.error_payload)
546-
order_state = errors_found.get("state", None)
547-
if order_state is None:
546+
if isinstance(errors_found, dict):
547+
order_state = errors_found.get("state", None)
548+
if order_state is None or 'market.order.invaild_id_or_uuid' in errors_found:
548549
self._order_not_found_records[order_id] = self._order_not_found_records.get(order_id, 0) + 1
549550
if order_state in Constants.ORDER_STATES['CANCEL_WAIT'] or \
550551
self._order_not_found_records.get(order_id, 0) >= self.ORDER_NOT_EXIST_CANCEL_COUNT:

0 commit comments

Comments
 (0)