diff --git a/piker/brokers/ib.py b/piker/brokers/ib.py index 1a230ec9..1d01907d 100644 --- a/piker/brokers/ib.py +++ b/piker/brokers/ib.py @@ -448,14 +448,17 @@ class Client: symbol=sym, exchange=exch, ) - possibles = await self.ib.qualifyContractsAsync(con) - for i, condict in enumerate(sorted( - map(asdict, possibles), - # sort by expiry - key=lambda con: con['lastTradeDateOrContractMonth'], - )): - expiry = condict['lastTradeDateOrContractMonth'] - results[f'{sym}.{exch}.{expiry}'] = condict + try: + possibles = await self.ib.qualifyContractsAsync(con) + for i, condict in enumerate(sorted( + map(asdict, possibles), + # sort by expiry + key=lambda con: con['lastTradeDateOrContractMonth'], + )): + expiry = condict['lastTradeDateOrContractMonth'] + results[f'{sym}.{exch}.{expiry}'] = condict + except RequestError as err: + log.warning(err.message) return results