By default sidekiq will retry any jobs that throw an exception. That is fine. However, I want to be able to catch that exception so that my exception handler doesn't get notified, and then retry the job. How do I accomplish this in react?
So my code looks like this:
def perform
...
rescue ExcClass => ex
# log
end
But I want to actually retry that job.
Configure your error service client to ignore ExcClass. Sidekiq will retry, you don't get error reports.
If I'm following your question correctly, it sounds like you may want a custom error handler to do what you want:
Sidekiq.configure_server do |config|
config.error_handlers << Proc.new {|exception,context_hash| MyErrorService.notify(exception,context_hash) }
end
By default, Sidekiq will continue to retry your jobs automatically.
Does this answer your question? It's slightly confusing. Here are the docs from which I pulled the above information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With