Delayed_job: how to raise and log exceptions

I have this in a delayed job.

def perform
validation_warnings =
rescue Exception => e
BackgroundProcessStatus.update(:status => “Process failed. Error:

I am finding that if an exception ocurrs somewhere in the code which is
being called (i.e. somewhere in Account#global_import_legacy_accounts),
job just quits and does not go into my rescue clause. Am I confused that
I have something wrapped in an begin…rescue that any exception below it
should raise up to this clause, or am I just having flashbacks of how C#
handles it? Anyway, what I need is a strategy to send a message and do
something if anything goes wrong in my delayed_job.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs