Reputation: 27557
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.
Upvotes: 0
Views: 271
Reputation: 27557
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
Upvotes: 1