nikhaldi / exception_notification-rake

Sends mail upon failures in Rake tasks
MIT License
39 stars 14 forks source link

rails: use runner API to handle exceptions in Rails runner #33

Open TylerRick opened 1 year ago

TylerRick commented 1 year ago

See https://github.com/airbrake/airbrake/issues/377 / https://github.com/airbrake/airbrake/pull/585

I use a lot of Rails runners instead of rake tasks for cron jobs these days. (Seems silly to have to add a new rake task for every new command, when all the rake task does is call a one-liner like SomeClass.send_reminders.)

But I was somewhat surprised to learn that these runner commands were failing and I wasn't getting any notifications. This is very bad!

I think most exception_notification Rails users would like to automatically be notified of errors occurring in their application generally, including background jobs, like what Airblade gives us (see railtie.rb), except using exception_notification ...