Can tenacity
handle this or should I implement retry wrapper myself if I need to catch exception do a callback and get back to next try?
send → fetch error → if recoverable → run callback → try send again
When I use a simple case with this code, next try never happened:
class A:
a = 0
@retry(stop=stop_after_attempt(7))
def never_give_up_never_surrender(cls):
try:
1/cls.a
print('possibly wrong')
except ZeroDivisionError:
cls.a+=1
print('next try')
else:
print('done')