Reputation: 1188
I have sidekiq jobs running Selenium. If the job crashes, I need to
Today I can catch and notify, but by catching the exception Sidekiq will not retry the job.
My question is similar to this one but a) it got no answer and b) that user did not want to notify its error handling service.
How do I get Sidekiq to retry the job even though I catch the exception?
Upvotes: 1
Views: 3918
Reputation: 51161
How about re-raising exception? It would be something like this:
def perform
# perform_code
rescue ErrorClass => error
# handle error
raise error
end
This way, sidekiq is gonna repeat this task (because it raises an error), but the handling code will also be executed.
Upvotes: 5