I have this in a delayed job.
def perform
begin
validation_warnings
Account.global_import_legacy_accounts(billing_run.legacy_master_iif_csv.path)
rescue Exception => e
BackgroundProcessStatus.update(:status => "Process failed. Error:
#{e}.")
end
end
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), the
job just quits and does not go into my rescue clause. Am I confused that if
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.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.