Exception Notifier Integration

292 views
Skip to first unread message

sant0sk1

unread,
Oct 2, 2009, 12:08:48 PM10/2/09
to delayed_job
Has anybody set up Delayed Job to work in conjunction with the
Exception Notifier Rails plugin so exceptions raised while running
jobs will get emailed?

If so, have any tips for me?

Brandon Keepers

unread,
Oct 2, 2009, 1:21:15 PM10/2/09
to delay...@googlegroups.com

Yep, it's fairly easy. I had to fork the exception_notification
plugin to make it work. http://github.com/collectiveidea/exception_notification

All you need to do is override Delayed::Job#log_exception:

Delayed::Job.class_eval do
def log_exception_with_notification(error)
log_exception_without_notification(error)
ExceptionNotifier.deliver_background_exception_notification
(error)
end
alias_method_chain :log_exception, :notification
end

Hope that helps.

Brandon

Jerod Santo

unread,
Oct 2, 2009, 1:30:04 PM10/2/09
to delay...@googlegroups.com
Just what I was looking for, thanks!
Reply all
Reply to author
Forward
0 new messages