From 8d0277815879eceb0ef1c22e8c264d5c3013a59f Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 10 Jun 2021 12:02:57 -0400 Subject: [PATCH] Don't bail on unknown order ids --- piker/ui/order_mode.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/piker/ui/order_mode.py b/piker/ui/order_mode.py index da775821..1535f458 100644 --- a/piker/ui/order_mode.py +++ b/piker/ui/order_mode.py @@ -399,7 +399,12 @@ async def start_order_mode( # each clearing tick is responded individually elif resp in ('broker_filled',): - action = book._sent_orders[oid].action + known_order = book._sent_orders.get(oid) + if not known_order: + log.warning(f'order {oid} is unknown') + continue + + action = known_order.action details = msg['brokerd_msg'] # TODO: some kinda progress system