Hey everybody I'm working on a data scraping project and I'm looking for a clean way to repeat a function call if an exception is raised.
Pseudo-code:
try:
myfunc(x)
except myError:
###try to call myfunc(x) again Y number of times,
until success(no exceptions raised) otherwise raise myError2
I realize this isn't best practice at all but I'm working through a number of different code/network layers that aren't reliable and I can't realistically debug them.
Right now I'm accomplishing this with a huge set of try\except blocks and it's making my eyes bleed.
Elegant ideas anyone?
from __past__ import goto