New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unsubscribe_ throws KeyError preventing the rest of symbols to unsubscribe #538
Comments
Hi overesko, thank you for contributing! Could you provide more information about what context you faced this issue, such as a code snippet? |
it is obvious, if you have a list of subscribed symbols, and try to unsubscribe them, if one of them is not in self.handlers['bars'] the rest of the loop fails, |
alpaca-trade-api-python/alpaca_trade_api/stream.py
Line 230 in a34b337
for symbol in symbols:
del self.handlers['bars'][symbol]
*Symbol KeyError (doesn't exist in handlers,)
this loop should try except or check keys before delete
same for all unsubscribe* methods
The text was updated successfully, but these errors were encountered: