Python continue from the point where exception was thrown
- by James Lin
Hi is there a way to continue from the point where exception was thrown?
eg I have the following psudo code
unique code 1
unique code 2
unique code 3
if I want to ignore the exceptions of any of the unique code statements I will have to do it like this:
try:
#unique code 1
except:
pass
try:
#unique code 2
except:
pass
try:
#unique code 3
except:
pass
but this isn't elegant to me, and for the life of me I can't remember how I resolved this kind of problem last time... what I want to have is something like
try:
unique code 1
unique code 2
unique code 3
except:
continue from last exception raised