So in the old plugin for Rails 2 there used to be a method called notifiable
that I could use to surround whatever Rake task I needed to attach exception notifier to. However, when I try to run my rake task it gives me an undefined method error. I looked around and noticed someone else use the exception_notify
method and tried replacing this:
task(:create_orders_for => :environment) do
notifiable do
...
end
end
with this:
exception_notify {:create_orders_for => :environment} do
#notifiable do
...
end
But it doesn't work. Does anyone know what the Rails 3 version of this method is? I can't find it anywhere.
So this is what I eventually ended up doing. Works great.
false
Change your rake task to this:
task(:create_orders_for => :environment) do begin ... rescue => e ExceptionNotifier::Notifier.exception_notification(Rails.env, e).deliver end
end
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.