Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Try...except

Hi there,

Every time I use this logic for error handling it times out my schedule function. Anybody else have this problem? The code seems to run normally otherwise (up to the point at which the exception occurs). Am I missing something?

while True:
try:
do something
except:
pass

1 response

When using the 'while True' code approach one needs to use a 'break' statement someplace to exit the 'while' loop. See https://wiki.python.org/moin/WhileLoop. Otherwise it will always stay in the loop (and therefore timeout). Not sure what the intention is but maybe change 'pass' to 'break'?