D
Deleted member 43669
Guest
I'm noticing more and more that the following:
or variations thereof is one of the most common reasons to write an except block in my code.
In my case, I believe this points me to the use of Celery: do_stuff should be a task invoked asynchronously and Celery should handle retrying/logging/notification of errors.
Do you see the above pattern a lot? Is it an anti-pattern? How do you usually handle it?
Cheers,
Álex
Code:
errs = []
for element in elements:
try:
do_stuff(element)
except err:
errs += err
if errs:
raise Exception(errs)
or variations thereof is one of the most common reasons to write an except block in my code.
In my case, I believe this points me to the use of Celery: do_stuff should be a task invoked asynchronously and Celery should handle retrying/logging/notification of errors.
Do you see the above pattern a lot? Is it an anti-pattern? How do you usually handle it?
Cheers,
Álex