I am using several smallish custom defs that get called in an iterator. In the instance one of the defs catches an exception I want it to quit that definition and keep the script running. Main flow is as follows:
for TIME in QueuedTimes:
def1(DATE, TIME)
def2(DATE, TIME)
def3(DATE, TIME)
Assuming all is well in the upstream def1(), I would like the logic of def2() as follows
def def2(DATE, TIME):
<beginstuff>
while True:
if exists(fileloaderror):
print 'found error'
break
else:
print 'pass'
break
<end stuff>
This while True
works, but only to evaluate the conditions. I want the break to jump to the end of def2()
and proceed to def3()
and skip all the rest of the <end stuff>
that would be broken by the exception I hope to catch. Is there a more trusted way of doing this?